X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=gnulib-tool;h=89037fb192ae98cd882c4c7b931b79a700b6411a;hb=69a9b8f8d7acc8677b5657adb83a8ba448737e0c;hp=e7ecbeb4ec4788423b8483bcd921488a578d2ef8;hpb=8dd5bc762c8793b6cbf1af03c79cec3ebbabd83d;p=gnulib.git diff --git a/gnulib-tool b/gnulib-tool index e7ecbeb4e..89037fb19 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,8 +22,8 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2002-12-31 13:47:17 $' -last_checkin_date=`echo "$cvsdatestamp" | sed -e 's/^\$Date: 2002-12-31 13:47:17 $$//'` +cvsdatestamp='$Date: 2003-01-21 13:21:17 $' +last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. @@ -57,6 +57,7 @@ Usage: gnulib-tool --list gnulib-tool --extract-autoconf-snippet module gnulib-tool --extract-automake-snippet module gnulib-tool --extract-include-directive module + gnulib-tool --extract-maintainer module Operation modes: --list print the available module names @@ -65,15 +66,16 @@ Operation modes: --create-megatestdir create a mega scratch package with the given modules one by one and all together --test test the combination of the given modules - (recommended to use CC="gcc -Wall -Werror" here) + (recommended to use CC=\"gcc -Wall\" here) --megatest test the given modules one by one and all together - (recommended to use CC="gcc -Wall -Werror" here) + (recommended to use CC=\"gcc -Wall\" here) --extract-description extract the description --extract-filelist extract the list of files --extract-dependencies extract the dependencies --extract-autoconf-snippet extract the snippet for configure.ac --extract-automake-snippet extract the snippet for lib/Makefile.am --extract-include-directive extract the #include directive + --extract-maintainer report the maintainer(s) inside gnulib Options: --dir=DIRECTORY specify the target directory @@ -212,7 +214,7 @@ gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` func_all_modules () { (cd "$gnulib_dir/modules" && ls -1) \ - | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^TEMPLATE$/d' \ + | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^TEMPLATE$/d' -e '/~$/d' \ | sort } @@ -221,13 +223,15 @@ func_all_modules () func_verify_module () { if test ! -f "$gnulib_dir/modules/$module" \ - || test "CVS" = "$module" || test "ChangeLog" = "$module" || test "TEMPLATE" = "$module"; then - echo "gnulib-tool: module $1 doesn't exist" 1>&2 + || test "CVS" = "$module" \ + || test "ChangeLog" = "$module" \ + || test "TEMPLATE" = "$module"; then + echo "gnulib-tool: module $module doesn't exist" 1>&2 module= fi } -tags_regexp='\(Description\|Files\|Depends-on\|configure\.ac\|Makefile\.am\|Include\)' +tags_regexp='\(Description\|Files\|Depends-on\|configure\.ac\|Makefile\.am\|Include\|Maintainer\)' sed_extract_prog=':[ ]*$/ { :a n @@ -277,6 +281,12 @@ func_get_include_directive () sed -e 's/^\(["<]\)/#include \1/' } +# func_get_maintainer module +func_get_maintainer () +{ + sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1" +} + # func_create_testdir testdir modules func_create_testdir () { @@ -316,13 +326,19 @@ func_create_testdir () # Create directories. for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do - mkdir -p "$testdir/$d" + if test "$d" != config; then + mkdir -p "$testdir/$d" + fi done # Copy files. for f in $files; do - ln "$gnulib_dir/$f" "$testdir/$f" 2>/dev/null || - cp -p "$gnulib_dir/$f" "$testdir/$f" + case "$f" in + config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;; + *) g="$f" ;; + esac + ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null || + cp -p "$gnulib_dir/$f" "$testdir/$g" done # Create lib/Makefile.am. @@ -346,7 +362,7 @@ func_create_testdir () for module in $modules; do func_verify_module if test -n "$module"; then - func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' + func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' -e "s,lib_OBJECTS,$libname"'_a_OBJECTS,g' if test "$module" = 'alloca'; then echo "$libname"'_a_LIBADD += @ALLOCA@' echo '#'"$libname"'_la_LIBADD += @LTALLOCA@' @@ -510,7 +526,9 @@ case $mode in if test -z "$destdir"; then func_fatal_error "please specify --dir option" fi - mkdir "$destdir" || func_fatal_error "could not create destination directory" + mkdir "$destdir" + test -d "$destdir" \ + || func_fatal_error "could not create destination directory" func_create_testdir "$destdir" "$*" ;; @@ -626,6 +644,16 @@ case $mode in done ;; + extract-maintainer ) + for module + do + func_verify_module + if test -n "$module"; then + func_get_maintainer "$module" + fi + done + ;; + * ) func_fatal_error "unknown operation mode --$mode" ;; esac