diff options
author | James Youngman <jay@gnu.org> | 2011-05-31 11:07:42 +0100 |
---|---|---|
committer | James Youngman <jay@gnu.org> | 2011-05-31 11:07:42 +0100 |
commit | d30da49b0026be4c48c612229d022bee8f3e516c (patch) | |
tree | 863618f1f5e34a2c1dbff9f4fa56e20d67c59ce5 | |
parent | fab81d4607cdc1f332808502e695cc7fa59ce764 (diff) | |
download | findutils-d30da49b0026be4c48c612229d022bee8f3e516c.tar.gz |
import-gnulib.sh now stops if it sees the old directory layout.
* import-gnulib.sh (check_old_gnulib_dir_layout): Check the
./gnulib-git, ./gnulib/ and ./gl/ subdirectories to figure out if
we are using a current version of import-gnulib.sh with an old
directory layout. If so, print an explanation of the problem and
return false.
(main): stop if check_old_gnulib_dir_layout didn't like the
directory layout.
-rw-r--r-- | ChangeLog | 9 | ||||
-rwxr-xr-x | import-gnulib.sh | 55 |
2 files changed, 64 insertions, 0 deletions
@@ -1,5 +1,14 @@ 2011-05-31 James Youngman <jay@gnu.org> + import-gnulib.sh now stops if it sees the old directory layout. + * import-gnulib.sh (check_old_gnulib_dir_layout): Check the + ./gnulib-git, ./gnulib/ and ./gl/ subdirectories to figure out if + we are using a current version of import-gnulib.sh with an old + directory layout. If so, print an explanation of the problem and + return false. + (main): stop if check_old_gnulib_dir_layout didn't like the + directory layout. + Minor fixes in import-gnulib.sh. * import-gnulib.sh (fixmsg): Fix punctuation in the commands given for installing the changelog driver. diff --git a/import-gnulib.sh b/import-gnulib.sh index cf4f8f0e..9912e092 100755 --- a/import-gnulib.sh +++ b/import-gnulib.sh @@ -315,6 +315,56 @@ record_config_change() { } +check_old_gnulib_dir_layout() { + # We used to keep the gnulib git repo in ./gnulib-git/ and use + # ./gnulib/ as the destination directory into which we installed + # (part of) the gnulib code. This changed and now ./gnulib/ + # contains the gnulib submodule and the destination directory is + # ./gl/. In other words, ./gnulib/ used to be the destination, + # but now it is the source. +fixmsg="\ +Findutils now manages the gnulib source code as a git submodule. + +If you are still using the directory layout in which the git tree for +gnulib lives in ./gnulib-git/, please fix this and re-run import-gnulib.sh. +The fix is very simple; please delete both ./gnulib/ and ./gnulib-git. + +This wasn't done automatically for you just in case you had any local changes. +" + + if test -d ./gl/; then + # Looks like we're already in the new directory layout. + true + elif test -d ./gnulib-git/; then + cat >&2 <<EOF +You still have a ./gnulib-git directory. + +$fixmsg +EOF + false + else + # No ./gl/ and no ./gnulib-git/. If ./gnulib/ exists, it might + # be either. If there is no ./gnulib/ we are safe to proceed anyway. + if test -d ./gnulib/; then + if test -d ./gnulib/.git; then + # Looks like it is the submodule. + true + else + cat >&2 <<EOF +You have a ./gnulib directory which does not appear to be a submodule. + +$fixmsg +EOF + false + fi + else + # No ./gl/, no ./gnulib/, no ./gnulib-git/. + # It is safe to proceed anyway. + true + fi + fi +} + main() { ## Option parsing local gnulibdir=/doesnotexist @@ -341,6 +391,11 @@ EOF exit 1 fi + # Check for the old directory layout. + echo "Checking the submodule directory layout... " + check_old_gnulib_dir_layout || exit 1 + echo "The submodule directory layout looks OK." + do_submodule gnulib check_merge_driver gnulibdir=gnulib |