changeset 6943:64f144ace584

Sync from upstream.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 09 Jul 2006 16:31:39 +0000
parents 9e87d8474fb1
children 823fc50dfbd9
files ChangeLog build-aux/depcomp build-aux/install-sh doc/ChangeLog doc/maintain.texi doc/make-stds.texi
diffstat 6 files changed, 263 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* build-aux/depcomp, build-aux/install-sh: Sync from Automake.
+
 2006-07-08  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* gnulib-tool (func_get_filelist): Don't echo m4/onceonly_2_57.m4,
--- a/build-aux/depcomp
+++ b/build-aux/depcomp
@@ -1,7 +1,7 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2006-05-10.23
+scriptversion=2006-07-09.11
 
 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
 # Foundation, Inc.
@@ -335,7 +335,7 @@
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # compilations output dependencies in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -39,8 +39,7 @@
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
 
 nl='
 '
@@ -50,6 +49,11 @@
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
 doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -66,17 +70,9 @@
 posix_glob=
 posix_mkdir=
 
-# Symbolic mode for testing mkdir with directories.
-# It is the same as 755, but also tests that "u+" works.
-test_mode=u=rwx,g=rx,o=rx,u+wx
-
 # Desired mode of installed file.
 mode=0755
 
-# Desired mode of newly created intermediate directories.
-# It is empty if not known yet.
-intermediate_mode=
-
 chmodcmd=$chmodprog
 chowncmd=
 chgrpcmd=
@@ -133,6 +129,12 @@
     -m) mode=$2
         shift
         shift
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
         continue;;
 
     -o) chowncmd="$chownprog $2"
@@ -191,7 +193,32 @@
   exit 0
 fi
 
-test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
 
 for src
 do
@@ -274,46 +301,67 @@
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-	posix_mkdir=false
-	if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
-	  posix_mkdir=true
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
 	else
-	  # Remove any dirs left behind by ancient mkdir implementations.
-	  rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
-	fi ;;
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- / "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      # Check for bugs in HP-UX 11.23 and IRIX 6.5 mkdir.
+	      case `ls -ld "$tmpdir"` in
+		d????-??-* ) posix_mkdir=:;;
+	      esac
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
     esac
 
     if
-      $posix_mkdir && {
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, create it using the same intermediate mode that
-	# mkdir -p would use when creating intermediate directories.
-	# POSIX says that this mode is "$(umask -S),u+wx", so use that
-	# if umask -S works.
-
-	if test -n "$dir_arg"; then
-	  mkdir_mode=$mode
-	else
-	  case $intermediate_mode in
-	    '')
-	      if umask_S=`(umask -S) 2>/dev/null`; then
-		intermediate_mode=$umask_S,u+wx
-	      else
-		intermediate_mode=$test_mode
-	      fi ;;
-	  esac
-	  mkdir_mode=$intermediate_mode
-	fi
-
-	$mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
-      }
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
     then :
     else
 
-      # mkdir does not conform to POSIX, or it failed possibly due to
-      # a race condition.  Create the directory the slow way, step by
-      # step, checking for races as we go.
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
 	/*) prefix=/ ;;
@@ -349,7 +397,8 @@
 	  prefixes=
 	else
 	  if $posix_mkdir; then
-	    $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" && break
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
 	    # Don't fail if two instances are running concurrently.
 	    test -d "$prefix" || exit 1
 	  else
@@ -365,7 +414,9 @@
 
       if test -n "$prefixes"; then
 	# Don't fail if two instances are running concurrently.
-	eval "\$mkdirprog $prefixes" || test -d "$dstdir" || exit 1
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
 	obsolete_mkdir_used=true
       fi
     fi
@@ -375,7 +426,7 @@
     { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
     { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
     { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
 
     # Make a couple of temp file names in the proper directory.
@@ -386,7 +437,7 @@
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -397,7 +448,7 @@
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
+      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
 
     # Now rename the file to the real destination.
     { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* maintain.texi, make-stds.texi: Sync from
+	<http://savannah.gnu.org/projects/gnustandards>.
+
 2006-06-29  Eric Blake  <ebb9@byu.net>
 
 	* functions.texi (Function Portability): Document missing lstat
--- a/doc/maintain.texi
+++ b/doc/maintain.texi
@@ -5,7 +5,7 @@
 @c For double-sided printing, uncomment:
 @c @setchapternewpage odd
 @c This date is automagically updated when you save this file:
-@set lastupdate March 22, 2006
+@set lastupdate July 1, 2006
 @c %**end of header
 
 @dircategory GNU organization
@@ -1077,6 +1077,8 @@
 @menu
 * Automated Upload Registration::
 * Automated Upload Procedure::
+* FTP Upload Directive File - v1.1::
+* FTP Upload Directive File - v1.0::
 @end menu
 
 
@@ -1118,7 +1120,7 @@
 
 @cindex uploads
 
-Once you have registered your information, as described in the
+Once you have registered your information as described in the
 previous section, you will be able to do unattended ftp uploads using
 the following procedure.
 
@@ -1128,7 +1130,7 @@
 
 @enumerate
 @item
-File to distributed (e.g., @file{foo.tar.gz}).
+The file to be distributed (for example, @file{foo.tar.gz}).
 
 @item
 Detached GPG binary signature for (1), made using @samp{gpg -b}
@@ -1137,24 +1139,149 @@
 @item
 A clearsigned @dfn{directive file}, made using @samp{gpg --clearsign}
 (for example, @file{foo.tar.gz.directive.asc}).
-
 @end enumerate
 
-Upload the triplet via anonymous ftp to @code{ftp-upload.gnu.org}.  If
-the upload is destined for @code{ftp.gnu.org}, then place the triplet
-in the @file{/incoming/ftp} directory.  If the upload is destined for
-@code{alpha.gnu.org}, then place the triplet in the
-@file{/incoming/alpha} directory.
+The names of the files are important. The signature file must have the
+same name as the file to be distributed, with an additional
+@file{.sig} extension. The directive file must have the same name as
+the file to be distributed, with an additional @file{.directive.asc
+extension}. If you do not follow this naming convention, the upload
+@emph{will not be processed}.
+
+Since v1.1 of the upload script, it is also possible to upload a
+@dfn{directive file} on its own to perform certain operations on
+uploaded files.  @xref{FTP Upload Directive File - v1.1}, for more
+information.
+
+Upload the file(s) via anonymous ftp to @code{ftp-upload.gnu.org}. If
+the upload is destined for @code{ftp.gnu.org}, place the file(s) in
+the @file{/incoming/ftp} directory. If the upload is destined for
+@code{alpha.gnu.org}, place the file(s) in the @file{/incoming/alpha}
+directory.
+
+Uploads are processed every five minutes. Uploads that are in progress while
+the upload processing script is running are handled properly, so do not worry
+about the timing of your upload.
+
+Your designated upload email addresses (@pxref{Automated Upload Registration})
+are sent a message if there are any problems processing an upload for your
+package. You also receive a message when your upload has been successfully
+processed.
+
+If you have difficulties processing an upload, email
+@email{ftp-upload@@gnu.org}.
+
+
+@node FTP Upload Directive File - v1.1
+@subsection FTP Upload Directive File - v1.1
+
+The directive file name must end in @file{directive.asc}.
+
+When part of a triplet, the directive file must always contain the
+directives @code{version}, @code{directory} and @code{filename}, as
+described. In addition, a 'comment' directive is allowed.
+
+The @code{version} directive must always have the value @samp{1.1}.
+
+The @code{directory} directive specifies the final destination
+directory where the uploaded file and its @file{.sig} companion are to
+be placed.
+
+The @code{filename} directive must contain the name of the file to be
+distributed (item@tie{}(1) above).
+
+For example, as part of an uploaded triplet, a
+@file{foo.tar.gz.directive.asc} file might contain these lines (before
+being gpg clearsigned):
+
+@example
+version: 1.1
+directory: bar/v1
+filename: foo.tar.gz
+comment: hello world!
+@end example
+
+This directory line indicates that @file{foo.tar.gz} and
+@file{foo.tar.gz.sig} are part of package @code{bar}.  If you uploaded
+this triplet to @file{/incoming/ftp} and the system positively
+authenticates the signatures, the files @file{foo.tar.gz} and
+@file{foo.tar.gz.sig} will be placed in the directory
+@file{gnu/bar/v1} of the @code{ftp.gnu.org} site.
 
-Uploads are processed every five minutes.  Uploads that are in
-progress when the upload processing script is running are handled
-properly, so do not worry about the timing of your upload.
+The directive file can be used to create currently non-existent
+directory trees, as long as they are under the package directory for
+your package (in the example above, that is @code{bar}).
+
+If you upload a file that already exists in the FTP directory, the
+original will simply be archived and replaced with the new upload.
+
+@subheading Standalone directives
+
+When uploaded by itself, the directive file must contain one or more
+of the directives @code{symlink}, @code{rmsymlink} or @code{archive},
+in addition to the obligatory @code{directory} and @code{version}
+directives.  A @code{filename} directive is not allowed, and a
+@code{comment} directive is optional.
+
+If you use more than one directive, the directives are executed in the
+sequence they are specified in.
+
+Here are a few examples.  The first removes a symlink:
+
+@example
+version: 1.1
+directory: bar/v1
+rmsymlink: foo-latest.tgz
+comment: remove a symlink
+@end example
+
+@noindent
+Archive an old file, taking it offline:
+
+@example
+version: 1.1
+directory: bar/v1
+archive: foo-1.1.tar.gz
+comment: archive an old file - it will not be available through FTP anymore
+@end example
+
+@noindent
+Create a new symlink:
+
+@example
+version: 1.1
+directory: bar/v1
+symlink: foo-1.2.tar.gz foo-latest.tgz
+comment: create a new symlink
+@end example
+
+@noindent
+Do everything at once:
+
+@example
+version: 1.1
+directory: bar/v1
+rmsymlink: foo-latest.tgz
+symlink: foo-1.2.tar.gz foo-latest.tgz
+archive: foo-1.1.tar.gz
+comment: now do everything at once
+@end example
+
+
+@node FTP Upload Directive File - v1.0
+@subsection FTP Upload Directive File - v1.0
+
+@dfn{As of June 2006, the upload script is running in compatibility
+mode, allowing uploads with either version@tie{}1.1 or
+version@tie{}1.0 of the directive file syntax.  Support for v1.0
+uploads will be phased out by the end of 2006, so please upgrade
+to@tie{}v1.1.}
 
 The directive file should contain one line, excluding the clearsigned
 data GPG that inserts, which specifies the final destination directory
-where items (1) and (2) to be placed.
+where items (1) and (2) are to be placed.
 
-For example, the @file{foo.tar.gz.directive} file might contain the
+For example, the @file{foo.tar.gz.directive.asc} file might contain the
 single line:
 
 @example
@@ -1172,14 +1299,6 @@
 directory trees, as long as they are under the package directory for
 your package (in the example above, that is @code{bar}).
 
-Your designated upload email addresses (@pxref{Automated Upload
-Registration}) are sent a message if there are any problems processing
-an upload for your package.  You also receive a message when your
-+upload has been successfully processed.
-
-If you have difficulties processing an upload, email
-@email{ftp-upload@@gnu.org}.
-
 
 @node Announcements
 @section Announcing Releases
--- a/doc/make-stds.texi
+++ b/doc/make-stds.texi
@@ -305,8 +305,9 @@
 @end example
 
 @noindent
-(Since the value of @code{DESTDIR} is only used during installation it
-is not necessary to provide it with other @code{make} commands.)
+Since the value of @code{DESTDIR} is only used during installation, it
+should only be supported in the @code{install*} and @code{uninstall*}
+targets.
 
 If your installation step would normally install
 @file{/usr/local/bin/foo} and @file{/usr/local/lib/libfoo.a}, then an
@@ -564,8 +565,7 @@
 @itemx pdfdir
 @itemx psdir
 Directories for installing documentation files in the particular
-format.  (It is not required to support documentation in all these
-formats.)  They should all be set to @code{$(docdir)} by default.  (If
+format.  They should all be set to @code{$(docdir)} by default.  (If
 you are using Autoconf, write them as @samp{@@htmldir@@},
 @samp{@@dvidir@@}, etc.)  Packages which supply several translations
 of their documentation should install them in
@@ -694,8 +694,9 @@
 @item all
 Compile the entire program.  This should be the default target.  This
 target need not rebuild any documentation files; Info files should
-normally be included in the distribution, and DVI files should be made
-only when explicitly asked for.
+normally be included in the distribution, and DVI (and other
+documentation format) files should be made only when explicitly asked
+for.
 
 By default, the Make rules should compile and link with @samp{-g}, so
 that executable programs have debugging symbols.  Users who don't mind
@@ -734,7 +735,7 @@
 Here is a sample rule to install an Info file:
 
 @comment This example has been carefully formatted for the Make manual.
-@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
+@comment Please do not reformat it without talking to bug-make@gnu.org.
 @smallexample
 $(DESTDIR)$(infodir)/foo.info: foo.info
         $(POST_INSTALL)
@@ -777,6 +778,9 @@
 certainly want to use subdirectories, or two nodes with the same name
 in different manuals will overwrite each other.
 
+Please make these @code{install-@var{format}} targets depend on the
+correspond @var{format} target.
+
 @item uninstall
 Delete all the installed files---the copies that the @samp{install}
 and @samp{install-*} targets create.