New module description field 'Comment'.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Mar 2010 19:52:28 +0000 (20:52 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Mar 2010 19:52:28 +0000 (20:52 +0100)
ChangeLog
gnulib-tool
modules/TEMPLATE-EXTENDED

index 788a079..0d65edb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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 (func_usage): Document --extract-applicability option.
 
index c17d889..b314dc5 100755 (executable)
@@ -133,6 +133,7 @@ Usage: gnulib-tool --list
        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
@@ -163,6 +164,7 @@ Operation modes:
       --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
@@ -1401,6 +1403,7 @@ sed_extract_prog=':[       ]*$/ {
   :a
     n
     s/^Description:[    ]*$//
+    s/^Comment:[        ]*$//
     s/^Status:[         ]*$//
     s/^Notice:[         ]*$//
     s/^Applicability:[  ]*$//
@@ -1424,6 +1427,7 @@ sed_extract_prog=':[       ]*$/ {
 # 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/
@@ -1716,6 +1720,32 @@ func_get_description ()
   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
@@ -5289,6 +5319,16 @@ s/\([.*$]\)/[\1]/g'
     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
index d3f3e84..c9e9051 100644 (file)
@@ -1,5 +1,7 @@
 Description:
 
+Comment:
+
 Status:
 
 Notice: