comparison gnulib-tool @ 6443:1a35941d29ab

Implement the --update option.
author Bruno Haible <bruno@clisp.org>
date Fri, 04 Nov 2005 18:25:19 +0000
parents d33210bfaeae
children d4112cb80f32
comparison
equal deleted inserted replaced
6442:74f7f6a4a0f9 6443:1a35941d29ab
20 # This program is meant for authors or maintainers which want to import 20 # This program is meant for authors or maintainers which want to import
21 # modules from gnulib into their packages. 21 # modules from gnulib into their packages.
22 22
23 progname=$0 23 progname=$0
24 package=gnulib 24 package=gnulib
25 cvsdatestamp='$Date: 2005-10-23 17:31:48 $' 25 cvsdatestamp='$Date: 2005-11-04 18:25:19 $'
26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` 26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` 27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
28 28
29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. 29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH.
30 AUTOCONFPATH= 30 AUTOCONFPATH=
42 func_usage () 42 func_usage ()
43 { 43 {
44 echo "\ 44 echo "\
45 Usage: gnulib-tool --list 45 Usage: gnulib-tool --list
46 gnulib-tool --import [module1 ... moduleN] 46 gnulib-tool --import [module1 ... moduleN]
47 gnulib-tool --update
47 gnulib-tool --create-testdir --dir=directory module1 ... moduleN 48 gnulib-tool --create-testdir --dir=directory module1 ... moduleN
48 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN] 49 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
49 gnulib-tool --test --dir=directory module1 ... moduleN 50 gnulib-tool --test --dir=directory module1 ... moduleN
50 gnulib-tool --megatest --dir=directory [module1 ... moduleN] 51 gnulib-tool --megatest --dir=directory [module1 ... moduleN]
51 gnulib-tool --extract-description module 52 gnulib-tool --extract-description module
235 mode=list 236 mode=list
236 shift ;; 237 shift ;;
237 --import | --impor | --impo | --imp | --im | --i ) 238 --import | --impor | --impo | --imp | --im | --i )
238 mode=import 239 mode=import
239 shift ;; 240 shift ;;
241 --update | --updat | --upda | --upd | --up | --u )
242 mode=update
243 shift ;;
240 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t ) 244 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
241 mode=create-testdir 245 mode=create-testdir
242 shift ;; 246 shift ;;
243 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m ) 247 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m )
244 mode=create-megatestdir 248 mode=create-megatestdir
347 do_changelog=false 351 do_changelog=false
348 shift ;; 352 shift ;;
349 --dry-run ) 353 --dry-run )
350 doit=false 354 doit=false
351 shift ;; 355 shift ;;
352 -s | --symbolic | --symlink ) 356 -s | --symbolic | --symboli | --symbol | --symbo | --symb | --symlink | --symlin | --symli | --syml | --sym | --sy )
353 symbolic=true 357 symbolic=true
354 shift ;; 358 shift ;;
355 --help | --hel | --he | --h ) 359 --help | --hel | --he | --h )
356 func_usage 360 func_usage
357 exit 0 ;; 361 exit 0 ;;
368 exit 1 ;; 372 exit 1 ;;
369 * ) 373 * )
370 break ;; 374 break ;;
371 esac 375 esac
372 done 376 done
377
378 if test "$mode" = update; then
379 if test $# != 0; then
380 echo "gnulib-tool: too many arguments in 'update' mode" 1>&2
381 echo "Try 'gnulib-tool --help' for more information." 1>&2
382 echo "If you really want to modify the gnulib configuration of your project," 1>&2
383 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
384 exit 1
385 fi
386 if test -n "$libname" || test -n "$sourcebase" || test -n "$m4base" \
387 || test -n "$testsbase" || test -n "$auxdir" || test -n "$inctests" \
388 || test -n "$avoidlist" || test -n "$lgpl" || test -n "$macro_prefix"; then
389 echo "gnulib-tool: invalid options for 'update' mode" 1>&2
390 echo "Try 'gnulib-tool --help' for more information." 1>&2
391 echo "If you really want to modify the gnulib configuration of your project," 1>&2
392 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
393 exit 1
394 fi
395 do_changelog=false
396 fi
373 397
374 # Remove trailing slashes from the directory names. This is necessary for 398 # Remove trailing slashes from the directory names. This is necessary for
375 # m4base (to avoid an error in func_import) and optional for the others. 399 # m4base (to avoid an error in func_import) and optional for the others.
376 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' 400 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
377 case "$sourcebase" in 401 case "$sourcebase" in
1601 1625
1602 list ) 1626 list )
1603 func_all_modules 1627 func_all_modules
1604 ;; 1628 ;;
1605 1629
1606 import ) 1630 import | update )
1631
1607 # Where to import. 1632 # Where to import.
1608 if test -z "$destdir"; then 1633 if test -z "$destdir"; then
1609 destdir=. 1634 destdir=.
1610 fi 1635 fi
1611 test -d "$destdir" \ 1636 test -d "$destdir" \