bug-gnulib
[Top][All Lists]
Advanced

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

Re: obsolete modules


From: Bruno Haible
Subject: Re: obsolete modules
Date: Sun, 2 Nov 2008 16:17:00 +0100
User-agent: KMail/1.5.4

Jim Meyering wrote:
> Go ahead and declare these modules "obsolescent", but
> rather than ripping out all dependencies on them,
> add an option to gnulib-tool (say, --ignore-obsolescent)
> to tell it to do ignore any dependency on an obsolescent module.

Good idea. I'm adding a gnulib-tool command line option to control this
behaviour. But I'm making the "ignore obsolete dependencies" behaviour
the default, not the "ignore all dependencies" behaviour. The latter is
more correct, but the majority of packages don't require portability to
museum systems. People are likely to be upset about too many included
sources (cf. Sam Steingold's mail [1]). If someone asks "I ran gnulib-tool;
now I have an strdup replacement among my sources; why?" and we cannot
even name the systems which lack strdup, we're not convincing.

[1] http://lists.gnu.org/archive/html/bug-gnulib/2008-10/msg00497.html


2008-11-02  Bruno Haible  <address@hidden>

        * gnulib-tool: New option --with-obsolete.
        (func_usage): Document it.
        (func_modules_transitive_closure): Drop obsolete dependencies if
        incobsolete is not true.
        (func_import): Read and save the incobsolete variable to the cache.

*** gnulib-tool.orig    2008-11-02 16:05:12.000000000 +0100
--- gnulib-tool 2008-11-02 15:59:35.000000000 +0100
***************
*** 167,172 ****
--- 167,175 ----
        --aux-dir=DIRECTORY   Directory relative to --dir where auxiliary build
                              tools are placed (default \"build-aux\").
        --with-tests          Include unit tests for the included modules.
+       --with-obsolete       Include obsolete modules when they occur among the
+                             dependencies. By default, dependencies to obsolete
+                             modules are ignored.
        --avoid=MODULE        Avoid including the given MODULE. Useful if you
                              have code that provides equivalent functionality.
                              This option can be repeated.
***************
*** 748,753 ****
--- 751,757 ----
  # - testsbase       from --tests-base
  # - auxdir          from --aux-dir
  # - inctests        true if --with-tests was given, blank otherwise
+ # - incobsolete     true if --with-obsolete was given, blank otherwise
  # - avoidlist       list of modules to avoid, from --avoid
  # - lgpl            yes or a number if --lgpl was given, blank otherwise
  # - makefile_name   from --makefile-name
***************
*** 778,783 ****
--- 782,788 ----
    testsbase=
    auxdir=
    inctests=
+   incobsolete=
    avoidlist=
    lgpl=
    makefile_name=
***************
*** 920,925 ****
--- 925,933 ----
        --with-tests )
          inctests=true
          shift ;;
+       --with-obsolete )
+         incobsolete=true
+         shift ;;
        --avoid )
          shift
          if test $# = 0; then
***************
*** 1030,1038 ****
      if test -n "$local_gnulib_dir" || test -n "$supplied_libname" \
         || test -n "$sourcebase" || test -n "$m4base" || test -n "$pobase" \
         || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \
!        || test -n "$inctests" || test -n "$avoidlist" || test -n "$lgpl" \
!        || test -n "$makefile_name" || test -n "$macro_prefix" \
!        || test -n "$po_domain" || test -n "$vc_files"; 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
--- 1038,1047 ----
      if test -n "$local_gnulib_dir" || test -n "$supplied_libname" \
         || test -n "$sourcebase" || test -n "$m4base" || test -n "$pobase" \
         || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \
!        || test -n "$inctests" || test -n "$incobsolete" \
!        || test -n "$avoidlist" || test -n "$lgpl" || test -n "$makefile_name" 
\
!        || test -n "$macro_prefix" || test -n "$po_domain" \
!        || test -n "$vc_files"; 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
***************
*** 1519,1524 ****
--- 1528,1535 ----
  # - local_gnulib_dir  from --local-dir
  # - modules         list of specified modules
  # - inctests        true if tests should be included, blank otherwise
+ # - incobsolete     true if obsolete modules among dependencies should be
+ #                   included, blank otherwise
  # - avoidlist       list of modules to avoid
  # - tmp             pathname of a temporary directory
  # Output:
***************
*** 1547,1553 ****
            if test -n "$duplicated_deps"; then
              echo "warning: module $module has duplicated dependencies: "`echo 
$duplicated_deps` 1>&2
            fi
!           func_append inmodules " $deps"
            if test -n "$inctests"; then
              testsmodule=`func_get_tests_module $module`
              if test -n "$testsmodule"; then
--- 1558,1569 ----
            if test -n "$duplicated_deps"; then
              echo "warning: module $module has duplicated dependencies: "`echo 
$duplicated_deps` 1>&2
            fi
!           for dep in $deps; do
!             if test -n "$incobsolete" \
!                || { status=`func_get_status $dep`; test "$status" != 
obsolete; }; then
!               func_append inmodules " $dep"
!             fi
!           done
            if test -n "$inctests"; then
              testsmodule=`func_get_tests_module $module`
              if test -n "$testsmodule"; then
***************
*** 2239,2244 ****
--- 2255,2261 ----
  # - testsbase       directory relative to destdir where to place unit test 
code
  # - auxdir          directory relative to destdir where to place build aux 
files
  # - inctests        true if --with-tests was given, blank otherwise
+ # - incobsolete     true if --with-obsolete was given, blank otherwise
  # - avoidlist       list of modules to avoid, from --avoid
  # - lgpl            yes or a number if library's license shall be LGPL,
  #                   blank otherwise
***************
*** 2262,2267 ****
--- 2279,2285 ----
    # Get the cached settings.
    cached_local_gnulib_dir=
    cached_specified_modules=
+   cached_incobsolete=
    cached_avoidlist=
    cached_sourcebase=
    cached_m4base=
***************
*** 2296,2301 ****
--- 2314,2322 ----
          :b
          s,^.*gl_MODULES([[ ]*\([^])]*\).*$,cached_specified_modules="\1",p
        }
+       /gl_WITH_OBSOLETE/ {
+         s,^.*$,cached_incobsolete=true,p
+       }
        /gl_AVOID(/ {
          s,^.*gl_AVOID([[ ]*\([^])]*\).*$,cached_avoidlist="\1",p
        }
***************
*** 2390,2395 ****
--- 2411,2420 ----
    # Append the cached and the specified module names. So that
    # "gnulib-tool --import foo" means to add the module foo.
    specified_modules="$cached_specified_modules $1"
+   # Included obsolete modules among the dependencies if specified either way.
+   if test -z "$incobsolete"; then
+     incobsolete="$cached_incobsolete"
+   fi
    # Append the cached and the specified avoidlist. This is probably better
    # than dropping the cached one when --avoid is specified at least once.
    avoidlist=`for m in $cached_avoidlist $avoidlist; do echo $m; done | 
LC_ALL=C sort -u`
***************
*** 2881,2886 ****
--- 2906,2914 ----
    if test -n "$inctests"; then
      func_append actioncmd " --with-tests"
    fi
+   if test -n "$incobsolete"; then
+     func_append actioncmd " --with-obsolete"
+   fi
    for module in $avoidlist; do
      func_append actioncmd " --avoid=$module"
    done
***************
*** 3166,3171 ****
--- 3194,3200 ----
      echo "gl_MODULES(["
      echo "$specified_modules" | sed 's/^/  /g'
      echo "])"
+     test -z "$incobsolete" || echo "gl_WITH_OBSOLETE"
      echo "gl_AVOID([$avoidlist])"
      echo "gl_SOURCE_BASE([$sourcebase])"
      echo "gl_M4_BASE([$m4base])"
***************
*** 4277,4285 ****
              for m4base in $m4dirs; do
                # Perform func_import in a subshell, so that variable values
                # such as
!               #   local_gnulib_dir, avoidlist, sourcebase, m4base, pobase,
!               #   docbase, testsbase, inctests, libname, lgpl, makefile_name,
!               #   libtool, macro_prefix, po_domain, vc_files
                # don't propagate from one directory to another.
                (func_import) || func_exit 1
              done
--- 4306,4314 ----
              for m4base in $m4dirs; do
                # Perform func_import in a subshell, so that variable values
                # such as
!               #   local_gnulib_dir, incobsolete, avoidlist, sourcebase, 
m4base,
!               #   pobase, docbase, testsbase, inctests, libname, lgpl,
!               #   makefile_name, libtool, macro_prefix, po_domain, vc_files
                # don't propagate from one directory to another.
                (func_import) || func_exit 1
              done





reply via email to

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