changeset 9189:1d7d9694f1e2

Allow for modules to show an arbitrary notice.
author Bruno Haible <bruno@clisp.org>
date Sun, 09 Sep 2007 12:17:35 +0000
parents 7bf3aff81ae2
children a4f83e0e605c
files ChangeLog gnulib-tool modules/TEMPLATE-EXTENDED
diffstat 3 files changed, 64 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Sep 09 11:49:57 2007 +0000
+++ b/ChangeLog	Sun Sep 09 12:17:35 2007 +0000
@@ -1,3 +1,15 @@
+2007-09-09  Bruno Haible  <bruno@clisp.org>
+
+	Allow for modules to show an arbitrary notice.
+	* modules/TEMPLATE-EXTENDED: Add 'Notice' field.
+	* gnulib-tool: New option --extract-notice.
+	(func_usage): Document it.
+	(sed_extract_prog): Update.
+	(func_get_notice): New function.
+	(func_modules_notice): New function.
+	(func_import, func_create_testdir): Invoke it.
+	Suggested by Jim Meyering.
+
 2007-09-09  Bruno Haible  <bruno@clisp.org>
 
 	* gnulib-tool: New options --verbose, --quiet.
--- a/gnulib-tool	Sun Sep 09 11:49:57 2007 +0000
+++ b/gnulib-tool	Sun Sep 09 12:17:35 2007 +0000
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2007-09-09 11:49:58 $'
+cvsdatestamp='$Date: 2007-09-09 12:17:36 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
@@ -89,6 +89,7 @@
        gnulib-tool --test --dir=directory module1 ... moduleN
        gnulib-tool --megatest --dir=directory [module1 ... moduleN]
        gnulib-tool --extract-description module
+       gnulib-tool --extract-notice module
        gnulib-tool --extract-filelist module
        gnulib-tool --extract-dependencies module
        gnulib-tool --extract-autoconf-snippet module
@@ -114,6 +115,7 @@
       --megatest            test the given modules one by one and all together
                             (recommended to use CC=\"gcc -Wall\" here)
       --extract-description        extract the description
+      --extract-notice             extract the notice or banner
       --extract-filelist           extract the list of files
       --extract-dependencies       extract the dependencies
       --extract-autoconf-snippet   extract the snippet for configure.ac
@@ -1142,6 +1144,7 @@
   :a
     n
     s/^Description:[	 ]*$//
+    s/^Notice:[	 ]*$//
     s/^Files:[	 ]*$//
     s/^Depends-on:[	 ]*$//
     s/^configure\.ac-early:[	 ]*$//
@@ -1166,6 +1169,15 @@
   sed -n -e "/^Description$sed_extract_prog" < "$lookedup_file"
 }
 
+# func_get_notice module
+# Input:
+# - local_gnulib_dir  from --local-dir
+func_get_notice ()
+{
+  func_lookup_file "modules/$1"
+  sed -n -e "/^Notice$sed_extract_prog" < "$lookedup_file"
+}
+
 # func_get_filelist module
 # Input:
 # - local_gnulib_dir  from --local-dir
@@ -1444,6 +1456,27 @@
   fi
 }
 
+# func_modules_notice
+# Input:
+# - local_gnulib_dir  from --local-dir
+# - verbose         integer, default 0, inc/decremented by --verbose/--quiet
+# - modules         list of modules, including dependencies
+func_modules_notice ()
+{
+  if test $verbose -ge -1; then
+    for module in $modules; do
+      func_verify_module
+      if test -n "$module"; then
+        msg=`func_get_notice $module`
+        if test -n "$msg"; then
+          echo "Notice from module $module:"
+          echo "$msg" | sed -e 's/^/  /'
+        fi
+      fi
+    done
+  fi
+}
+
 # func_modules_to_filelist
 # Input:
 # - local_gnulib_dir  from --local-dir
@@ -1463,7 +1496,6 @@
   files=`for f in $files; do echo $f; done | LC_ALL=C sort -u`
 }
 
-
 # func_execute_command command [args...]
 # Executes a command.
 # Uses also the variables
@@ -2148,6 +2180,9 @@
     done
   fi
 
+  # Show banner notice of every module.
+  func_modules_notice
+
   # Determine script to apply to imported library files.
   sed_transform_lib_file=
   for module in $modules; do
@@ -3068,6 +3103,9 @@
   # Add the dummy module if needed.
   func_modules_add_dummy
 
+  # Show banner notice of every module.
+  func_modules_notice
+
   # Determine final file list.
   func_modules_to_filelist
   if test $verbose -ge 0; then
@@ -3749,6 +3787,16 @@
     done
     ;;
 
+  extract-notice )
+    for module
+    do
+      func_verify_module
+      if test -n "$module"; then
+        func_get_notice "$module"
+      fi
+    done
+    ;;
+
   extract-filelist )
     for module
     do
--- a/modules/TEMPLATE-EXTENDED	Sun Sep 09 11:49:57 2007 +0000
+++ b/modules/TEMPLATE-EXTENDED	Sun Sep 09 12:17:35 2007 +0000
@@ -1,5 +1,7 @@
 Description:
 
+Notice:
+
 Files:
 
 Depends-on: