bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: gnulib-tool questions


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: gnulib-tool questions
Date: Fri, 4 Nov 2005 19:19:13 +0100
User-agent: KMail/1.5

Simon Josefsson wrote:
> > Which is wrong, the
> > docs or a missing option in gnulib-tool?
>
> I believe you should use "gnulib-tool --import".  If you don't want
> ChangeLog updates, use --no-changelog.  Ok to install patch below?

No, the doc was right, but the option was not yet implemented.
Done it now (patch attached).

The major difference between --import and --update is that it is meant for
different people: --import for the master developer of a project,
--update for the other developers (no need to understand how it works).
Similar to:
         autoconf              vs.  autoreconf
         gettextize            vs.  autopoint
         gnulib-tool --import  vs.  gnulib-tool --update


> > Second, I am working on a patch to make the dirname module behave better
> > on cygwin (it wasn't respecting // as distinct from /; and cygwin, unlike
> > DJGPP, treats c:dir the same as c:/dir rather than tracking an additional
> > 26 relative directories for each drive letter).  I have converted the
> > test app that is currently in lib/dirname.c into a full blown
> > modules/dirname-tests and tests/test-dirname.c, but now I can't figure
> > out how to get gnulib-tool --test to compile and run test-dirname.c.
>
> Here is what I use:
>
> ./gnulib-tool --create-testdir --dir=/tmp/testdir module1 --with-tests 
> foo-tests
>
> then build the project in /tmp/testdir as usual.
>
> I think "--with-tests foo" should be sufficient.  It should auto-add
> the *-tests modules, if present, if --with-tests is given.

Yes, it does this. For testing, the two are equivalent.

Bruno



*** gnulib-tool 23 Oct 2005 17:31:48 -0000      1.90
--- gnulib-tool 4 Nov 2005 18:19:09 -0000
***************
*** 44,49 ****
--- 44,50 ----
    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,242 ****
--- 238,246 ----
        --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 ;;
***************
*** 371,376 ****
--- 375,400 ----
      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,1609 ****
      func_all_modules
      ;;
  
!   import )
      # Where to import.
      if test -z "$destdir"; then
        destdir=.
--- 1627,1634 ----
      func_all_modules
      ;;
  
!   import | update )
!     
      # Where to import.
      if test -z "$destdir"; then
        destdir=.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]