From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32318 invoked by alias); 24 Oct 2012 21:10:02 -0000 Received: (qmail 32281 invoked by uid 22791); 24 Oct 2012 21:10:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Oct 2012 21:09:54 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2C4A72E06E for ; Wed, 24 Oct 2012 17:09:54 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PUkxPJOtHVqb for ; Wed, 24 Oct 2012 17:09:54 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0FE882E06C for ; Wed, 24 Oct 2012 17:09:54 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 744B6C9C3B; Wed, 24 Oct 2012 17:09:51 -0400 (EDT) Date: Wed, 24 Oct 2012 21:10:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA] script to update our gnulib-import (take 2) Message-ID: <20121024210951.GI3523@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00485.txt.bz2 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1063 Hello, This is an updated version of the script I proposed a few months ago: http://www.sourceware.org/ml/gdb-patches/2011-12/msg00337.html At the time, we held off on it because gnulib's bootstrap was supposed to do the same thing. It's been 10+ months since that suggestion was made, so I think we should go ahead with this script. Independently of bootstrap, what this script brings is a verification that the right versions of the auto-tools are being used. This avoid unwanted changes due to differing versions. It also allows us to store the gnulib SHA1 used for the import, rather than having to fish it out from somewhere in a ChangeLog file. If someone ever gets to using gnulib's bootstrap, then great - I think it can easily be folded into this script. In the meantime, it helps, because I no longer have to figure how to regenerate the configury and the makefiles... gdb/ChangeLog: * gnulib/update-gnulib.sh: New script. Script tested by running it, and verifying that it does not introduce any change. OK to commit? Thanks, -- Joel --MGYHOYXEY6WxJCY8 Content-Type: application/x-sh Content-Disposition: attachment; filename="update-gnulib.sh" Content-Transfer-Encoding: quoted-printable Content-length: 4406 #! /bin/sh=0A= =0A= # Copyright (C) 2011 Free Software Foundation, Inc.=0A= #=0A= # This file is part of GDB.=0A= #=0A= # This program is free software; you can redistribute it and/or modify=0A= # it under the terms of the GNU General Public License as published by=0A= # the Free Software Foundation; either version 3 of the License, or=0A= # (at your option) any later version.=0A= #=0A= # This program is distributed in the hope that it will be useful,=0A= # but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= # GNU General Public License for more details.=0A= #=0A= # You should have received a copy of the GNU General Public License=0A= # along with this program. If not, see .=0A= =0A= # Usage: update-gnulib.sh =0A= # Update our import of gnulib in the GDB source tree.=0A= #=0A= # This script assumes that it is being called from the gdb/gnulib=0A= # subdirectory, and will verify this before proceeding.=0A= #=0A= # This script will also make a number of other verifications:=0A= # . The gnulib version (it should match $GNULIB_COMMIT_SHA1).=0A= # . The correct versions of the auto-tools that are used to=0A= # regenerate the various scripts and Makefiles are on the PATH.=0A= =0A= # The list of gnulib modules we are importing in GDB.=0A= IMPORTED_GNULIB_MODULES=3D"fnmatch-gnu inttypes memmem update-copyright"=0A= =0A= # The gnulib commit ID to use for the update.=0A= GNULIB_COMMIT_SHA1=3D"a39f53ccb70a613e647e1019fb4c63645220267e"=0A= =0A= # The expected version number for the various auto tools we will=0A= # use after the import.=0A= AUTOCONF_VERSION=3D"2.64"=0A= AUTOMAKE_VERSION=3D"1.11.1"=0A= ACLOCAL_VERSION=3D"$AUTOMAKE_VERSION"=0A= =0A= if [ $# -ne 1 ]; then=0A= echo "Error: Path to gnulib repository missing. Aborting."=0A= echo "Usage: update-gnulib.sh "=0A= exit 1=0A= fi=0A= gnulib_prefix=3D$1=0A= =0A= gnulib_tool=3D"$gnulib_prefix/gnulib-tool"=0A= =0A= # Verify that the gnulib directory does exist...=0A= if [ ! -f "$gnulib_tool" ]; then=0A= echo "Error: Invalid gnulib directory. Cannot find gnulib tool"=0A= echo " ($gnulib_tool)."=0A= echo "Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the right version of gnulib...=0A= gnulib_head_sha1=3D`cd $gnulib_prefix && git rev-parse HEAD`=0A= if [ "$gnulib_head_sha1" !=3D "$GNULIB_COMMIT_SHA1" ]; then=0A= echo "Error: Wrong version of gnulib: $gnulib_head_sha1"=0A= echo " (we expected it to be $GNULIB_COMMIT_SHA1)"=0A= echo "Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we are in the gdb/ subdirectory.=0A= if [ ! -f ../main.c -o ! -d import ]; then=0A= echo "Error: This script should be called from the gdb/gnulib subdirecto= ry."=0A= echo "Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of autoconf.=0A= ver=3D`autoconf --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$AUTOCONF_VERSION" ]; then=0A= echo "Error: Wrong autoconf version: $ver. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of automake.=0A= ver=3D`automake --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$AUTOMAKE_VERSION" ]; then=0A= echo "Error: Wrong automake version ($ver), we need $AUTOMAKE_VERSION."= =0A= echo "Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of aclocal.=0A= ver=3D`aclocal --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$ACLOCAL_VERSION" ]; then=0A= echo "Error: Wrong aclocal version: $ver. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Update our gnulib import.=0A= $gnulib_prefix/gnulib-tool --import --dir=3D. --lib=3Dlibgnu \=0A= --source-base=3Dimport --m4-base=3Dimport/m4 --doc-base=3Ddoc \=0A= --tests-base=3Dtests --aux-dir=3Dimport/extra \=0A= --no-conditional-dependencies --no-libtool --macro-prefix=3Dgl \=0A= --no-vc-files \=0A= $IMPORTED_GNULIB_MODULES=0A= if [ $? -ne 0 ]; then=0A= echo "Error: gnulib import failed. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Regenerate all necessary files...=0A= aclocal -Iimport/m4 &&=0A= autoconf &&=0A= automake=0A= if [ $? -ne 0 ]; then=0A= echo "Error: Failed to regenerate Makefiles and configure scripts."=0A= exit 1=0A= fi=0A= =0A= --MGYHOYXEY6WxJCY8--