From: Bruno Haible Date: Mon, 13 Jun 2011 10:29:46 +0000 (+0200) Subject: gnulib-tool: Allow comments in the 'Depends-on' section. X-Git-Tag: v0.1~2618 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=6c6ac3672f5a8079fcab8b60698496524d6bf698;p=gnulib.git gnulib-tool: Allow comments in the 'Depends-on' section. * doc/gnulib.texi (Module description): Mention comment syntax in the Depends-on section. * gnulib-tool (func_get_dependencies): Filter out comment lines. --- diff --git a/ChangeLog b/ChangeLog index b1bb0892f..2966496c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2011-06-13 Bruno Haible + gnulib-tool: Allow comments in the 'Depends-on' section. + * doc/gnulib.texi (Module description): Mention comment syntax in the + Depends-on section. + * gnulib-tool (func_get_dependencies): Filter out comment lines. + +2011-06-13 Bruno Haible + file-set.h: guard __attibute__ use, now that it's not always defined * lib/file-set.h (record_file): Use __attribute__ only with compiler versions that support it. This fixes a coreutils build failure with diff --git a/doc/gnulib.texi b/doc/gnulib.texi index e126c6f44..c08e4902e 100644 --- a/doc/gnulib.texi +++ b/doc/gnulib.texi @@ -406,6 +406,8 @@ statements. For example: strtoull [test $ac_cv_func_strtoumax = no] @end smallexample +Lines starting with @code{#} are recognized as comments and are ignored. + @item configure.ac-early This field contains @file{configure.ac} stuff (Autoconf macro invocations and shell statements) that are logically placed early in the @file{configure.ac} diff --git a/gnulib-tool b/gnulib-tool index 0f315a492..37073eded 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -2096,24 +2096,26 @@ func_get_dependencies () ;; esac # Then the explicit dependencies listed in the module description. - if ! $modcache; then - func_lookup_file "modules/$1" - sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file" - else - func_cache_lookup_module "$1" - # Output the field's value, including the final newline (if any). - if $have_associative; then - if eval 'test -n "${modcache_dependson[$1]+set}"'; then - eval 'echo "${modcache_dependson[$1]}"' - fi + { if ! $modcache; then + func_lookup_file "modules/$1" + sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file" else - eval "field_set=\"\$${cachevar}_dependson_set\"" - if test -n "$field_set"; then - eval "field_value=\"\$${cachevar}_dependson\"" - echo "${field_value}" + func_cache_lookup_module "$1" + # Output the field's value, including the final newline (if any). + if $have_associative; then + if eval 'test -n "${modcache_dependson[$1]+set}"'; then + eval 'echo "${modcache_dependson[$1]}"' + fi + else + eval "field_set=\"\$${cachevar}_dependson_set\"" + if test -n "$field_set"; then + eval "field_value=\"\$${cachevar}_dependson\"" + echo "${field_value}" + fi fi fi - fi + } \ + | sed -e '/^#/d' } # func_get_autoconf_early_snippet module