changeset 6443:1a35941d29ab

Implement the --update option.
author Bruno Haible <bruno@clisp.org>
date Fri, 04 Nov 2005 18:25:19 +0000
parents 74f7f6a4a0f9
children a144eefda6e8
files ChangeLog gnulib-tool
diffstat 2 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-04  Bruno Haible  <bruno@clisp.org>
+
+	* gnulib-tool: Implement --update mode.
+
 2005-10-28  Simon Josefsson  <jas@extundo.com>
 
 	* tests/test-gc-md4.c, tests/test-gc-md5.c, tests/test-gc-sha1.c:
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2005-10-23 17:31:48 $'
+cvsdatestamp='$Date: 2005-11-04 18:25:19 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 
@@ -44,6 +44,7 @@
   echo "\
 Usage: gnulib-tool --list
        gnulib-tool --import [module1 ... moduleN]
+       gnulib-tool --update
        gnulib-tool --create-testdir --dir=directory module1 ... moduleN
        gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
        gnulib-tool --test --dir=directory module1 ... moduleN
@@ -237,6 +238,9 @@
       --import | --impor | --impo | --imp | --im | --i )
         mode=import
         shift ;;
+      --update | --updat | --upda | --upd | --up | --u )
+        mode=update
+        shift ;;
       --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
         mode=create-testdir
         shift ;;
@@ -349,7 +353,7 @@
       --dry-run )
         doit=false
         shift ;;
-      -s | --symbolic | --symlink )
+      -s | --symbolic | --symboli | --symbol | --symbo | --symb | --symlink | --symlin | --symli | --syml | --sym | --sy )
         symbolic=true
         shift ;;
       --help | --hel | --he | --h )
@@ -371,6 +375,26 @@
     esac
   done
 
+  if test "$mode" = update; then
+    if test $# != 0; then
+      echo "gnulib-tool: too many arguments in 'update' mode" 1>&2
+      echo "Try 'gnulib-tool --help' for more information." 1>&2
+      echo "If you really want to modify the gnulib configuration of your project," 1>&2
+      echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
+      exit 1
+    fi
+    if test -n "$libname" || test -n "$sourcebase" || test -n "$m4base" \
+       || test -n "$testsbase" || test -n "$auxdir" || test -n "$inctests" \
+       || test -n "$avoidlist" || test -n "$lgpl" || test -n "$macro_prefix"; then
+      echo "gnulib-tool: invalid options for 'update' mode" 1>&2
+      echo "Try 'gnulib-tool --help' for more information." 1>&2
+      echo "If you really want to modify the gnulib configuration of your project," 1>&2
+      echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
+      exit 1
+    fi
+    do_changelog=false
+  fi
+
   # Remove trailing slashes from the directory names. This is necessary for
   # m4base (to avoid an error in func_import) and optional for the others.
   sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
@@ -1603,7 +1627,8 @@
     func_all_modules
     ;;
 
-  import )
+  import | update )
+    
     # Where to import.
     if test -z "$destdir"; then
       destdir=.