+2009-12-19 Bruno Haible <bruno@clisp.org>
+
+ New module attribute 'Applicability'.
+ * modules/TEMPLATE-EXTENDED: New field 'Applicability'.
+ * gnulib-tool: New option --extract-applicability.
+ (func_usage): Document it.
+ (sed_extract_prog): Recognize it.
+ (func_get_applicability): New function.
+ (func_import): Generalize handling of 'link-warning' module.
+ * modules/link-warning (Applicability): New section.
+ * modules/arg-nonnull (Applicability): New section.
+ Repoted by Simon Josefsson <simon@josefsson.org>.
2009-12-19 Bruno Haible <bruno@clisp.org>
gnulib-tool --extract-description module
gnulib-tool --extract-status module
gnulib-tool --extract-notice module
+ gnulib-tool --extract-applicability module
gnulib-tool --extract-filelist module
gnulib-tool --extract-dependencies module
gnulib-tool --extract-autoconf-snippet module
s/^Description:[ ]*$//
s/^Status:[ ]*$//
s/^Notice:[ ]*$//
+ s/^Applicability:[ ]*$//
s/^Files:[ ]*$//
s/^Depends-on:[ ]*$//
s/^configure\.ac-early:[ ]*$//
sed -n -e "/^Notice$sed_extract_prog" < "$lookedup_file"
}
+# func_get_applicability module
+# Input:
+# - local_gnulib_dir from --local-dir
+# The expected result (on stdout) is either 'main', or 'tests', or 'all'.
+func_get_applicability ()
+{
+ func_lookup_file "modules/$1"
+ { sed -n -e "/^Applicability$sed_extract_prog" < "$lookedup_file"
+ # The default is 'main' or 'tests', depending on the module's name.
+ case "$1" in
+ *-tests) echo "tests";;
+ *) echo "main";;
+ esac
+ } | sed -e 's,^ *$,,' | sed -e 1q
+}
+
# func_get_filelist module
# Input:
# - local_gnulib_dir from --local-dir
# is specified, it will consist only of LGPLed source.
# The tests-related module list is the transitive closure of the specified
# modules, including tests modules, minus the main module list excluding
- # 'link-warning'. Its lib/* sources (brought in through dependencies of
- # *-tests modules) go into $testsbase/. It may contain GPLed source, even if
- # --lgpl is specified.
+ # modules of applicability 'all'. Its lib/* sources (brought in through
+ # dependencies of *-tests modules) go into $testsbase/. It may contain GPLed
+ # source, even if --lgpl is specified.
# Determine main module list.
saved_inctests="$inctests"
inctests=""
fi
# Determine tests-related module list.
echo "$final_modules" | LC_ALL=C sort -u > "$tmp"/final-modules
- sed_remove_link_warning='/^link-warning$/d'
- testsrelated_modules=`func_reset_sigpipe; echo "$main_modules" | LC_ALL=C sort -u | sed -e "$sed_remove_link_warning" | LC_ALL=C join -v 2 - "$tmp"/final-modules`
+ testsrelated_modules=`func_reset_sigpipe
+ for module in $main_modules; do
+ if test \`func_get_applicability $module\` = main; then
+ echo $module
+ fi
+ done \
+ | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/final-modules`
if test $verbose -ge 1; then
echo "Tests-related module list:"
echo "$testsrelated_modules" | sed -e 's/^/ /'
done
;;
+ extract-applicability )
+ for module
+ do
+ func_verify_module
+ if test -n "$module"; then
+ func_get_applicability "$module"
+ fi
+ done
+ ;;
+
extract-filelist )
for module
do