Re: new module: update-copyright [Re: copyright years: mass-update every January 1

2009-07-30 Thread Jim Meyering
Joel E. Denny wrote:

> On Wed, 29 Jul 2009, Jim Meyering wrote:
>
>> Joel E. Denny wrote:
>>
>> > On Wed, 29 Jul 2009, Jim Meyering wrote:
>> >
>> >> Joel E. Denny wrote:
>> >
>> >> > I'd like to use this in Bison.  Would you consider contributing
>> >> > build-aux/update-copyright to gnulib so we don't maintain separate 
>> >> > copies?
>> >>
>> >> Sure.
>> >
>> > Thanks.  I'll watch for that.  In the meantime, I'll probably import a
>> > copy into Bison.
>>
>> I've just pushed it to gnulib:
>
> Thanks.  I didn't notice this before I posted that last patch to
> bug-coreutils:
>
>   http://lists.gnu.org/archive/html/bug-coreutils/2009-07/msg00213.html
>
> Here it is again, rewritten for gnulib.  I've also made some improvements
> to the documentation.

Thank you!

Here's an incremental change I'm about to fold into yours.
It changes "comment" to "prefix" and adjusts syntax.

There remains at least one infelicity: if someone discusses
the Copyright (C) notation (e.g., as on this line), and later
has the copyright-with-dates line, the prefixes may not match.
We could require that the Copyright...holder (and hence prefix)
are all in proximity, but that may not be worth the trouble.

diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index c4419b5..e35d51b 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -0777 -pi
 # Update an FSF copyright year list to include the current year.

-my $VERSION = '2009-07-29.19:13'; # UTC
+my $VERSION = '2009-07-30.13:24'; # UTC

 # Copyright (C) 2009 Free Software Foundation
 #
@@ -22,10 +22,10 @@ my $VERSION = '2009-07-29.19:13'; # UTC

 # In the copyright statement in each file, "Copyright (C)" must appear
 # at the beginning of the line except that it may be preceded by any
-# comment sequence of no more than 5 characters.  Iff that comment
-# sequence is present, the same comment sequence should appear at the
-# beginning of each remaining line within the copyright statement so
-# that it can be parsed correctly.
+# sequence (e.g., a comment) of no more than 5 characters.  Iff that
+# prefix is present, the same prefix should appear at the beginning
+# of each remaining line within the copyright statement so that it
+# can be parsed correctly.
 #
 # For example, these are fine:
 #
@@ -52,11 +52,11 @@ my $VERSION = '2009-07-29.19:13'; # UTC
 #
 #   .PHONY: update-copyright
 #   update-copyright:
-#  if test -d .git; then   \
-#git grep -l -w Copyright  \
-#  | grep -v -E '(^|/)(COPYING|ChangeLog)' \
-#  | xargs $(srcdir)/build-aux/$@; \
-#  fi
+#   if test -d .git; then   \
+# git grep -l -w Copyright  \
+#   | grep -v -E '(^|/)(COPYING|ChangeLog)' \
+#   | xargs $(srcdir)/build-aux/$@; \
+#   fi
 #
 # You can build a list of files to skip in the second grep.

@@ -67,12 +67,12 @@ my ($sec, $min, $hour, $mday, $month, $year) = localtime 
(time());
 my $this_year = $year + 1900;
 my $holder = 'Free Software Foundation';

-my $comment = "";
+my $prefix = '';
 if (/(?:^|\n)(.{0,5})Copyright \([cC]\)/) {
-  $comment = quotemeta($1);
+  $prefix = quotemeta $1;
 }
 $holder = " $holder";
-$holder =~ s/\s/\\s*(?:\\s|\\n$comment)\\s*/g;
+$holder =~ s/\s/\\s*(?:\\s|\\n$prefix)\\s*/g;

 if (/([- ])((?:\d\d)?\d\d)($holder)/s)
   {




Re: new module: update-copyright [Re: copyright years: mass-update every January 1

2009-07-30 Thread Joel E. Denny
On Thu, 30 Jul 2009, Jim Meyering wrote:

> Thank you!

Thank you.  :)

> Here's an incremental change I'm about to fold into yours.
> It changes "comment" to "prefix" and adjusts syntax.

Makes sense.

> There remains at least one infelicity: if someone discusses
> the Copyright (C) notation (e.g., as on this line), and later
> has the copyright-with-dates line, the prefixes may not match.
> We could require that the Copyright...holder (and hence prefix)
> are all in proximity, but that may not be worth the trouble.

The current behavior is a little unintuitive in other similar ways as 
well.  For example, if "Copyright (C)" isn't recognized anywhere and thus 
no comment sequence is recognized, the script still looks for an 
occurrence of the copyright year and holder to adjust.  Thus, the script 
handles "Copyright @copyright{}" only when it's not in comments.  I'd 
rather it be consistent by not handling it at all or handling it 
completely.

I'm working on a patch to fix all of the above and to automatically format 
the result to 72 columns.  I'll try to post a patch soon.





gnulib-tool --avoid problems

2009-07-30 Thread Sam Steingold
Bruno,
I am trying to use the gnulib-tool --avoid to put the gnulib regexp code
in the regexp directory, fnmatch code in the wildcard dir &c.
So far I came up with the following in Makefile.devel:

GNULIB = $(GNULIB_CHECKOUT)/gnulib-tool --import --no-vc-files --no-libtool \
--no-changelog --aux-dir=src/build-aux
GNULIB_CORE = stdint stdbool havelib gettext localcharset \
uniwidth/width streq uniname/uniname unitypes link-follow \
nocrash libsigsegv gnu-make gettimeofday getpagesize sys_time
# these modules are included as dependencies by regexp and fnmatch
# so we include them here so that they appear once in src/gl*
# instead of twice in regexp/gl* and wildcard/gl*
GNULIB_MODULES = alloca-opt alloca extensions include_next verify \
mbsinit wchar wctype mbrtowc mbsrtowcs \
memmove memcmp memchr
GNULIB_COMMON = $(GNULIB_CORE) $(GNULIB_MODULES)
GNULIB_AVOID = $(addprefix --avoid=, $(GNULIB_COMMON))
gnulib-imported : update-gnulib force
$(RM) configure.ac; ln -sv src/configure.in configure.ac
$(GNULIB) --source-base=src/gllib --m4-base=src/glm4 $(GNULIB_COMMON)
$(GNULIB) --source-base=modules/regexp/gllib --macro-prefix=rx_gl \
--m4-base=modules/regexp/glm4 $(GNULIB_AVOID) regex
$(GNULIB) --source-base=modules/wildcard/gllib --macro-prefix=wc_gl \
--m4-base=modules/wildcard/glm4 $(GNULIB_AVOID) fnmatch-gnu
$(RM) configure.ac
for d in src/gllib modules/regexp/gllib modules/wildcard/gllib; do \
  $(RM) `find $d -name \*~`; done

alas, there is still some duplication between
modules/regexp/glm4 and src/glm4, specifically:
  codeset.m4
  locale-fr.m4
  locale-ja.m4
  locale-zh.m4
  mbrtowc.m4
  mbstate_t.m4
  unistd_h.m4
and between modules/regexp/gllib and src/gllib, specifically:
  unistd.in.h

also, build-dir/gllib no longer builds:

$ make gllib
mkdir -p gllib
if test ! -f gllib/Makefile; then sh config.status gllib/Makefile depfiles; fi
config.status: creating gllib/Makefile
config.status: executing depfiles commands
cd gllib && make CFLAGS="-W -Wswitch -Wcomment -Wpointer-arith -Wimplicit 
-Wreturn-type -Wmissing-declarations -Wno-sign-compare -Wno-format-nonliteral 
-O2 -fexpensive-optimizations -falign-functions=4 -DUNICODE -DDYNAMIC_FFI -I. "
make[1]: Entering directory `/home/sds/src/clisp/current/build-O/gllib'
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
  cat ../../src/gllib/alloca.in.h; \
} > alloca.h-t
mv -f alloca.h-t alloca.h
rm -f configmake.h-t
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
  echo '#define PREFIX "/usr/local"'; \
  echo '#define EXEC_PREFIX "/usr/local"'; \
  echo '#define BINDIR "/usr/local/bin"'; \
  echo '#define SBINDIR "/usr/local/sbin"'; \
  echo '#define LIBEXECDIR "/usr/local/libexec"'; \
  echo '#define DATAROOTDIR "/usr/local/share"'; \
  echo '#define DATADIR "/usr/local/share"'; \
  echo '#define SYSCONFDIR "/usr/local/etc"'; \
  echo '#define SHAREDSTATEDIR "/usr/local/com"'; \
  echo '#define LOCALSTATEDIR "/usr/local/var"'; \
  echo '#define INCLUDEDIR "/usr/local/include"'; \
  echo '#define OLDINCLUDEDIR "/usr/include"'; \
  echo '#define DOCDIR "/usr/local/share/doc/clisp"'; \
  echo '#define INFODIR "/usr/local/share/info"'; \
  echo '#define HTMLDIR "/usr/local/share/doc/clisp"'; \
  echo '#define DVIDIR "/usr/local/share/doc/clisp"'; \
  echo '#define PDFDIR "/usr/local/share/doc/clisp"'; \
  echo '#define PSDIR "/usr/local/share/doc/clisp"'; \
  echo '#define LIBDIR "/usr/local/lib"'; \
  echo '#define LISPDIR ""'; \
  echo '#define LOCALEDIR "/usr/local/share/locale"'; \
  echo '#define MANDIR "/usr/local/share/man"'; \
  echo '#define MANEXT ""'; \
  echo '#define PKGDATADIR "/usr/local/share/clisp"'; \
  echo '#define PKGINCLUDEDIR "/usr/local/include/clisp"'; \
  echo '#define PKGLIBDIR "/usr/local/lib/clisp"'; \
  echo '#define PKGLIBEXECDIR ""'; \
} | sed '/""/d' > configmake.h-t
if test -f configmake.h && cmp configmake.h-t configmake.h > /dev/null; then \
  rm -f configmake.h-t; \
else \
  rm -f configmake.h; mv configmake.h-t configmake.h; \
fi
rm -f string.h-t string.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
  sed -e 's|@''INCLUDE_NEXT''@|include_next|g' \
  -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
  -e 's|@''NEXT_STRING_H''@||g' \
  -e 's|@''GNULIB_MBSLEN''@||g' \
  -e 's|@''GNULIB_MBSNLEN''@||g' \
  -e 's|@''GNULIB_MBSCHR''@||g' \
  -e 's|@''GNULIB_MBSRCHR''@||g' \
  -e 's|@''GNULIB_MBSSTR''@||g' \
  -e 's|@''GNULIB_MBSCASECMP