+2010-03-27 Bruno Haible <bruno@clisp.org>
+
+ New module description field 'Comment'.
+ * gnulib-tool: New option --extract-comment.
+ (func_usage): Document it.
+ (sed_extract_prog, sed_extract_field_header): Support 'Comment' field.
+ (func_get_comment): New function.
+ * modules/TEMPLATE-EXTENDED: Add a blank Comment field.
+
2010-03-27 Bruno Haible <bruno@clisp.org>
Addendum to 2010-02-07 commit.
gnulib-tool --test --dir=directory module1 ... moduleN
gnulib-tool --megatest --dir=directory [module1 ... moduleN]
gnulib-tool --extract-description module
+ gnulib-tool --extract-comment module
gnulib-tool --extract-status module
gnulib-tool --extract-notice module
gnulib-tool --extract-applicability module
--megatest test the given modules one by one and all together
(recommended to use CC=\"gcc -Wall\" here)
--extract-description extract the description
+ --extract-comment extract the comment
--extract-status extract the status (obsolete or not)
--extract-notice extract the notice or banner
--extract-applicability extract the applicability
:a
n
s/^Description:[ ]*$//
+ s/^Comment:[ ]*$//
s/^Status:[ ]*$//
s/^Notice:[ ]*$//
s/^Applicability:[ ]*$//
# NOTE: Keep this in sync with sed_extract_prog above!
sed_extract_field_header='
s/^Description:[ ]*$/description/
+ s/^Comment:[ ]*$/comment/
s/^Status:[ ]*$/status/
s/^Notice:[ ]*$/notice/
s/^Applicability:[ ]*$/applicability/
fi
}
+# func_get_comment module
+# Input:
+# - local_gnulib_dir from --local-dir
+# - modcache true or false, from --cache-modules/--no-cache-modules
+func_get_comment ()
+{
+ if ! $modcache; then
+ func_lookup_file "modules/$1"
+ sed -n -e "/^Comment$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 test -n "${modcache_comment[$1]+set}"; then
+ echo "${modcache_comment[$1]}"
+ fi
+ else
+ eval "field_set=\"\$${cachevar}_comment_set\""
+ if test -n "$field_set"; then
+ eval "field_value=\"\$${cachevar}_comment\""
+ echo "${field_value}"
+ fi
+ fi
+ fi
+}
+
# func_get_status module
# Input:
# - local_gnulib_dir from --local-dir
done
;;
+ extract-comment )
+ for module
+ do
+ func_verify_module
+ if test -n "$module"; then
+ func_get_comment "$module"
+ fi
+ done
+ ;;
+
extract-status )
for module
do