Index: import-gnulib.config =================================================================== RCS file: /cvsroot/findutils/findutils/import-gnulib.config,v retrieving revision 1.1.2.5 diff -u -p -r1.1.2.5 import-gnulib.config --- import-gnulib.config 25 Aug 2007 22:16:28 -0000 1.1.2.5 +++ import-gnulib.config 8 Dec 2007 15:23:22 -0000 @@ -1,6 +1,6 @@ # findutils import-gnulib.config -*- sh -*- -gnulib_version="2007-08-23" +gnulib_version="8e128ebf42e16c8631f971a68f188c30962818be" destdir="gnulib" @@ -16,6 +16,13 @@ build-aux/missing build-aux/texinfo.tex ' +gpl3_update_files=' +build-aux/mdate-sh +build-aux/texinfo.tex +build-aux/ylwrap +' + + # Modules needed for findutils. # We need regex to ensure that we can build on platforms like # Solaris which lack those functions. Index: import-gnulib.sh =================================================================== RCS file: /cvsroot/findutils/findutils/import-gnulib.sh,v retrieving revision 1.21.4.4 diff -u -p -r1.21.4.4 import-gnulib.sh --- import-gnulib.sh 28 Jun 2007 17:12:50 -0000 1.21.4.4 +++ import-gnulib.sh 8 Dec 2007 15:23:22 -0000 @@ -3,20 +3,18 @@ # import-gnulib.sh -- imports a copy of gnulib into findutils # Copyright (C) 2003,2004,2005,2006,2007 Free Software Foundation, Inc. # -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. +# along with this program. If not, see . # ########################################################################## # @@ -33,10 +31,14 @@ unset CDPATH ## Defaults # cvsdir=/doesnotexist +git_repo="git://git.savannah.gnu.org/gnulib.git" configfile="./import-gnulib.config" need_checkout=yes +# Remember arguments for comments we inject into output files +original_cmd_line_args="$@" + usage() { cat >&2 <&2 @@ -62,48 +64,33 @@ do_checkout () { fi - if ! [ -d "$cvsdir" ] ; then - if mkdir "$cvsdir" ; then - echo "Created $cvsdir" + if ! [ -d "$gitdir" ] ; then + if mkdir "$gitdir" ; then + echo "Created $gitdir" else - echo "Failed to create $cvsdir" >&2 + echo "Failed to create $gitdir" >&2 exit 1 fi fi - # Decide if gnulib_version is probably a date or probably a tag. - if date -d yesterday >/dev/null ; then - # It looks like GNU date is available - if date -d "$gnulib_version" >/dev/null ; then - # Looks like a date. - cvs_sticky_option="-D" - else - echo "Warning: assuming $gnulib_version is a CVS tag rather than a date" >&2 - cvs_sticky_option="-r" - fi - else - # GNU date unavailable, assume the version is a date - cvs_sticky_option="-D" - fi - - - ( - # Change directory unconditionally (rater than using checkout -d) so that - # cvs does not pick up defaults from ./CVS. Those defaults refer to our - # own CVS repository for our code, not to gnulib. - cd $cvsdir - if test -d gnulib/CVS ; then - cd gnulib - cmd=update - root="" # use previous + # Change directory unconditionally. We used to do this to avoid + # the cvs client picking up defaults from findutils' ./CVS/*, but + # now we just do it for the sake of a minimum change. + cd $gitdir + + if test -d gnulib/.git ; then + echo "Git repository was already initialised." else - root="-d :pserver:address@hidden:/sources/gnulib" - cmd=checkout - args=gnulib + echo "Cloning the git repository..." + # In the future we may use a shallow clone to + # save bandwidth. + git clone "$git_repo" fi + cd gnulib set -x - cvs -q -z3 $root $cmd $cvs_sticky_option "$gnulib_version" $args + git fetch origin + git checkout "$gnulib_version" set +x ) } @@ -149,6 +136,43 @@ run_gnulib_tool() { find -L gnulib -lname '*' -delete 2>/dev/null || : } +rehack() { + echo "Updating the license of $1" + # Use cp to get the permissions right first + cp -fp "$1" "$1".new + sed -e \ +'s/Free Software Foundation\([;,]\) either version [2]/Free Software Foundation\1 either version 3/' < "$1" > "$1".new + if cmp "$1" "$1".new >/dev/null + then + rm -f "$1".new + else + rm -f "$1" && mv "$1".new "$1" + fi +} + + + +copyhack() { + src="$1" + dst="$2" + shift 2 + if test -d "$dst" + then + dst="$dst"/"$(basename $src)" + fi + cp -fp "$src" "$dst" && rehack "$dst" + +} + + +update_licenses() { + for f in $gpl3_update_files + do + rehack "$f" || exit + done +} + + hack_gnulib_tool_output() { local gnulibdir="${1}" @@ -157,10 +181,9 @@ hack_gnulib_tool_output() { */mdate-sh | */texinfo.tex) dest=doc;; *) dest=build-aux;; esac - test -d "$dest" || mkdir "$dest" - cp -fp "${gnulibdir}"/"$file" "$dest" || exit + copyhack "${gnulibdir}"/"$file" "$dest" || exit done - + @@ -173,7 +196,7 @@ hack_gnulib_tool_output() { # that contains a configuration script generated by Automake, under # the same distribution terms as the rest of that program. # -# This file was generated by $0 address@hidden +# This file was generated by $0 $original_cmd_line_args. # SUBDIRS = lib EOF @@ -184,7 +207,7 @@ refresh_output_files() { aclocal -I m4 -I gnulib/m4 && autoheader && autoconf && - automake --add-missing --copy + automake --add-missing --copy } @@ -212,13 +235,34 @@ EOF } +move_cvsdir() { + local cvs_git_root=":pserver:address@hidden:/gnulib.git" + + if test -d gnulib-cvs/gnulib/CVS + then + if test x"$(cat gnulib-cvs/gnulib/CVS/Root)" == x"$cvs_git_root"; then + # We cannot use the git-cvspserver interface because + # "update -D" doesn't work. + echo "WARNING: Migrating from git-cvs-pserver to native git..." >&2 + savedir=gnulib-cvs.before-nativegit-migration + else + # The old CVS repository is not updated any more. + echo "WARNING: Migrating from old CVS repository to native git" >&2 + savedir=gnulib-cvs.before-git-migration + fi + mv gnulib-cvs $savedir || exit 1 + echo "Please delete $savedir eventually" + fi +} + main() { ## Option parsing local gnulibdir=/doesnotexist - while getopts "d:" opt + while getopts "d:a" opt do case "$opt" in d) gnulibdir="$OPTARG" ; need_checkout=no ;; + a) refresh_output_files && update_licenses ; exit $? ;; **) usage; exit 1;; esac done @@ -227,10 +271,18 @@ main() { # to use, even if we don't want to know the CVS version. . $configfile || exit 1 - ## If -d was not given, do CVS checkout/update + ## If -d was not given, do update if [ $need_checkout = yes ] ; then - do_checkout gnulib-cvs - gnulibdir=gnulib-cvs/gnulib + if ! git version > /dev/null; then + cat >&2 <&2 fi @@ -241,6 +293,7 @@ main() { if run_gnulib_tool "${tool}" && hack_gnulib_tool_output "${gnulibdir}" && refresh_output_files && + update_licenses && update_version_file ; then echo Done. else Index: NEWS =================================================================== RCS file: /cvsroot/findutils/findutils/NEWS,v retrieving revision 1.101.2.40 diff -u -p -r1.101.2.40 NEWS --- NEWS 4 Dec 2007 23:53:03 -0000 1.101.2.40 +++ NEWS 8 Dec 2007 15:23:22 -0000 @@ -7,6 +7,11 @@ GNU findutils NEWS - User visible change ** Bug Fixes +#21568: When building from CVS in 4.2.x, we now check gnulib out using git +instead of CVS. This fixes Savannah bug 21568, the problem being that +git-cvspserevr does not currently support -D, and the ond CVS server +for gnulib has been frozen. + #20970: Trailing slash on directory arguments breaks -name. "find foo/ -name foo" now correctly matches foo and printf foo/. See POSIX interp http://www.opengroup.org/austin/interps/uploads/40/14959/AI-186.txt