head - Re: branch-1_4 use gnupload
Eric Blake <[email protected]>
| Newsgroups | gmane.comp.gnu.m4.patches |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 8/22/2006 2:32 PM: > Now that gnulib supplies gnupload, I can simplify releases > > I will be porting this, and several other gnulib-tool --import patches, to > CVS head next. > Here's all the modules that branch-1_4 was using but not head, except for tmpfile-safer (I'd like to move away from tmpfile, because the discussion on the gnulib list pointed out that tmpfile is not as clean as Bruno's clean-temp module). It also picks up regexprops-generic.texi from gnulib. 2006-08-22 Eric Blake <[email protected]> Start porting various fixes from the branch that use gnulib. * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp regexprops-generic stdlib-safer unlocked-io. * m4/debug.c (m4_debug_set_output): Close debug file on exec. * m4/path.c (m4_path_search): Close input file on exec, reject empty file name, fix parameter naming. * m4/output.c (make_room_for): Close diversion file on exec. (includes): Assume C89 headers. (tmpfile): For now, we don't want tmpfile-safer, because we want clean-temp later. * m4/m4private.h (includes): Use various gnulib headers. * doc/regexprops-generic.texi: Use gnulib's copy. - -- Life is short - so eat dessert first! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE64a984KuGfSFAYARAn6PAJ9nebFGXQxFuFWooUa2c0phDRYTyQCfWqC5 LQXCo+Hz19DbDEVfITY955g= =7wIC -----END PGP SIGNATURE----- _______________________________________________ M4-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch129
(text/plain, 9.5 KB)
Index: HACKING =================================================================== RCS file: /sources/m4/m4/HACKING,v retrieving revision 1.2 diff -u -p -r1.2 HACKING --- HACKING 22 Aug 2006 16:16:47 -0000 1.2 +++ HACKING 22 Aug 2006 22:31:22 -0000 @@ -183,35 +183,24 @@ yyyy-mm-dd Name of Author <email@addre * Run ./configure (or create a build directory first and run configure from there, if you want to keep the build tree separate). -* Run `make -fMakefile.maint fetch' (or `make -f../Makefile.maint fetch' - if you are running from a VPATH build directory, where `../' is the - relative path to the directory with `configure' in it), which will - fetch new versions of the files that are maintained outside of m4. If - you are using GNU make, the included GNUmakefile allows you to leave - off the '-fMakefile.maint'. - * Run `make distcheck'. If there are any problems, fix them and start again. * Run ./commit from the source tree. -* Run `make -fMakefile.maint cvs-dist' (or `make -f../Makefile.maint - cvs-dist' if you are running from a VPATH build directory, where `../' - is the relative path to the directory with `configure' in it), which - will build a release tarball (with `make distcheck'), tag the tree - with release-$(VERSION) and generate the gpg signature files. - -* Run 'make -f[../]Makefile.maint deltas' (pass - LASTRELEASE=maj.min[.mic[alpha]] if needed) to create both diff and - xdelta files between the previous release tarball and the new with - detached gpg signature files and clear signed directive files. - -* Upload release tarball, diff file and xdelta file, plus their associated - detached gpg signature files and clear signed directive files to - ftp-upload.gnu.org. If the upload is destined for ftp.gnu.org, then the - files should be placed in the /incoming/ftp directory. If the upload is - an alpha release destined for alpha.gnu.org, then the files should be - placed in the /incoming/alpha directory. +* Run `make cvs-dist', which will build a release tarball (with `make + distcheck'), and tag the tree with release-$(VERSION). + +* Run 'make deltas' (pass LASTRELEASE=maj.min[.mic[alpha]] if needed) to + create both diff and xdelta files between the previous release tarball + and the new. + +* Run '[../]./gnupload --to [dest].gnu.org:m4 [files]' to create + detached gpg signature and clear signed directive files, and upload + the combination to the correct location. For an alpha release, + gnupload will place files in alpha.gnu.org, in /incoming/alpha, and + the xdelta file is not strictly necessary. For a full release, + gnupload will place files in ftp.gnu.org, in /incoming/ftp. * Send announcement to [email protected], [email protected], and [email protected]. If not an alpha send to [email protected] @@ -226,7 +215,7 @@ yyyy-mm-dd Name of Author <email@addre * Run ./commit. * For non-alpha releases, update the webpages. Replace manual.html with - the new one (generate with `make -f[../]Makefile.maint web-manual'). + the new one (generate with `make web-manual'). 7. Alpha release note template Index: ltdl/m4/gnulib-cache.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/gnulib-cache.m4,v retrieving revision 1.7 diff -u -p -r1.7 gnulib-cache.m4 --- ltdl/m4/gnulib-cache.m4 9 Aug 2006 21:33:23 -0000 1.7 +++ ltdl/m4/gnulib-cache.m4 22 Aug 2006 22:31:22 -0000 @@ -15,10 +15,10 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnu --m4-base=ltdl/m4 --doc-base=doc --aux-dir=ltdl/config --libtool --macro-prefix=M4 assert error exit fdl free gendocs gettext mkstemp obstack progname regex stdbool strtol verror xalloc xalloc-die xstrndup xvasprintf +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnu --m4-base=ltdl/m4 --doc-base=doc --aux-dir=ltdl/config --libtool --macro-prefix=M4 assert binary-io cloexec close-stream error exit fdl fopen-safer free gendocs getopt gettext gnupload mkstemp obstack progname regex regexprops-generic stdbool stdlib-safer strtol unlocked-io verror xalloc xalloc-die xstrndup xvasprintf # Specification in the form of a few gnulib-tool.m4 macro invocations: -gl_MODULES([assert error exit fdl free gendocs gettext mkstemp obstack progname regex stdbool strtol verror xalloc xalloc-die xstrndup xvasprintf]) +gl_MODULES([assert binary-io cloexec close-stream error exit fdl fopen-safer free gendocs getopt gettext gnupload mkstemp obstack progname regex regexprops-generic stdbool stdlib-safer strtol unlocked-io verror xalloc xalloc-die xstrndup xvasprintf]) gl_AVOID([]) gl_SOURCE_BASE([gnu]) gl_M4_BASE([ltdl/m4]) Index: m4/debug.c =================================================================== RCS file: /sources/m4/m4/m4/debug.c,v retrieving revision 1.21 diff -u -p -r1.21 debug.c --- m4/debug.c 9 Aug 2006 21:33:24 -0000 1.21 +++ m4/debug.c 22 Aug 2006 22:31:22 -0000 @@ -154,6 +154,9 @@ m4_debug_set_output (m4 *context, const if (fp == NULL) return false; + if (set_cloexec_flag (fileno (fp), true) != 0) + m4_error (context, 0, errno, + _("cannot protect debug file across forks")); set_debug_file (context, fp); } return true; Index: m4/m4private.h =================================================================== RCS file: /sources/m4/m4/m4/m4private.h,v retrieving revision 1.53 diff -u -p -r1.53 m4private.h --- m4/m4private.h 9 Aug 2006 21:33:24 -0000 1.53 +++ m4/m4private.h 22 Aug 2006 22:31:22 -0000 @@ -31,6 +31,11 @@ #include "m4module.h" +#include "cloexec.h" +#include "stdio--.h" +#include "stdlib--.h" +#include "unistd--.h" + typedef struct m4__search_path_info m4__search_path_info; typedef enum { Index: m4/output.c =================================================================== RCS file: /sources/m4/m4/m4/output.c,v retrieving revision 1.26 diff -u -p -r1.26 output.c --- m4/output.c 9 Aug 2006 21:33:24 -0000 1.26 +++ m4/output.c 22 Aug 2006 22:31:22 -0000 @@ -22,19 +22,11 @@ # include <config.h> #endif +#include <errno.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> - -#if HAVE_UNISTD_H -# include <unistd.h> -#endif - -#include <errno.h> - -#ifndef errno -extern int errno; -#endif +#include <unistd.h> #include "m4private.h" @@ -56,6 +48,9 @@ extern int errno; extern FILE *tmpfile (); #endif +/* FIXME - hack until we get clean-temp gnulib module going. */ +#undef tmpfile + /* Output functions. Most of the complexity is for handling cpp like sync lines. @@ -206,6 +201,9 @@ make_room_for (m4 *context, int length) if (selected_diversion->file == NULL) m4_error (context, EXIT_FAILURE, errno, _("cannot create temporary file for diversion")); + if (set_cloexec_flag (fileno (selected_diversion->file), true) != 0) + m4_error (context, 0, errno, + _("cannot protect diversion across forks")); if (selected_diversion->used > 0) { Index: m4/path.c =================================================================== RCS file: /sources/m4/m4/m4/path.c,v retrieving revision 1.17 diff -u -p -r1.17 path.c --- m4/path.c 16 Aug 2006 12:23:05 -0000 1.17 +++ m4/path.c 22 Aug 2006 22:31:22 -0000 @@ -121,37 +121,52 @@ m4_add_include_directory (m4 *context, c } FILE * -m4_path_search (m4 *context, const char *dir, char **expanded_name) +m4_path_search (m4 *context, const char *file, char **expanded_name) { FILE *fp; m4__search_path *incl; char *name; /* buffer for constructed name */ int e; + if (expanded_name != NULL) + *expanded_name = NULL; + + /* Reject empty file. */ + if (*file == '\0') + { + errno = ENOENT; + return NULL; + } + /* Look in current working directory first. */ - fp = fopen (dir, "r"); + fp = fopen (file, "r"); if (fp != NULL) { + if (set_cloexec_flag (fileno (fp), true) != 0) + m4_error (context, 0, errno, + _("cannot protect input file across forks")); if (expanded_name != NULL) - *expanded_name = xstrdup (dir); + *expanded_name = xstrdup (file); return fp; } /* If file not found, and filename absolute, fail. */ - if (*dir == '/' || m4_get_no_gnu_extensions_opt (context)) + if (*file == '/' || m4_get_no_gnu_extensions_opt (context)) return NULL; - e= errno; + e = errno; - name = (char *) xmalloc (m4__get_search_path (context)->max_length + 1 + strlen (dir) + 1); + name = (char *) xmalloc (m4__get_search_path (context)->max_length + + 1 + strlen (file) + 1); - for (incl = m4__get_search_path (context)->list; incl != NULL; incl = incl->next) + for (incl = m4__get_search_path (context)->list; + incl != NULL; incl = incl->next) { strncpy (name, incl->dir, incl->len); name[incl->len] = '/'; - strcpy (name + incl->len + 1, dir); + strcpy (name + incl->len + 1, file); #ifdef DEBUG_INCL - fprintf (stderr, "path_search (%s) -- trying %s\n", dir, name); + fprintf (stderr, "path_search (%s) -- trying %s\n", file, name); #endif fp = fopen (name, "r"); @@ -159,11 +174,17 @@ m4_path_search (m4 *context, const char { if (BIT_TEST (m4_get_debug_level_opt (context), M4_DEBUG_TRACE_PATH)) M4_DEBUG_MESSAGE2 (context, _("path search for `%s' found `%s'"), - dir, name); + file, name); + if (set_cloexec_flag (fileno (fp), true) != 0) + m4_error (context, 0, errno, + _("cannot protect input file across forks")); if (expanded_name != NULL) - *expanded_name = xstrdup (name); - break; + *expanded_name = name; + else + free (name); + errno = e; + return fp; } }