bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: [Bug-tar] Re: argp-help.c patch for GNU tar; any more t


From: Paul Eggert
Subject: [Bug-gnulib] Re: [Bug-tar] Re: argp-help.c patch for GNU tar; any more thoughts on uClibc getopt?
Date: Thu, 12 Aug 2004 11:54:15 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Sergey Poznyakoff <address@hidden> writes:

> maintaining mailutils (which generates more than 50 binaries,
> sharing the same subset of options) without argp would be a real
> nightmare.

Thanks for explaining the advantages of argp.

I installed the following patch into tar to merge the recent gnulib
changes to argp, getopt, and xalloc.  This removes the need for the
special gnulib patches in tar.  You'll need to bootstrap with an
up-to-date gnulib after this change.

2004-08-12  Paul Eggert  <address@hidden>

        Merge argp, getopt, xalloc changes from gnulib.
        * bootstrap (gnulib_modules): Add xalloc-die.
        Remove code to test for patches; we don't have patches now.
        * patches/getopt.diff: Remove; gnulib now works unpatched.
        * configure.ac (_getopt_long_only_r): Remove check.
        gl_ARGP now does this for us.
        * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
        xalloc-die.c.
        * src/extract.c: Adjust to changes to gnulib xalloc module.
        (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
        (xalloc_die): New function.

Index: bootstrap
===================================================================
RCS file: /cvsroot/tar/tar/bootstrap,v
retrieving revision 1.18
diff -p -u -r1.18 bootstrap
--- bootstrap   8 Aug 2004 14:19:49 -0000       1.18
+++ bootstrap   12 Aug 2004 18:29:20 -0000
@@ -188,6 +188,7 @@ timespec
 unlocked-io
 utime
 xalloc
+xalloc-die
 xgetcwd
 xstrtoumax
 '
@@ -235,14 +236,6 @@ for gnulib_file in $gnulib_files; do
   cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
 done
 
-if [ -d patches ]; then
-    echo "$0: Patching gnulib"
-    for file in patches/*.diff
-    do
-      patch -p0 < $file
-    done
-fi
-
 echo "$0: Creating m4/gnulib.m4"
 (echo "# This file is generated automatically. Please, do not edit."
  echo "#"
Index: configure.ac
===================================================================
RCS file: /cvsroot/tar/tar/configure.ac,v
retrieving revision 1.44
diff -p -u -r1.44 configure.ac
--- configure.ac        3 Aug 2004 04:42:18 -0000       1.44
+++ configure.ac        12 Aug 2004 18:29:20 -0000
@@ -261,14 +261,6 @@ AC_CHECK_TYPE(iconv_t,:,
 #endif
 ])
 
-# Check if we have reentrant versions of getopt. Argp needs them,
-# but many versions of Glibc lack them, though they define the
-# same getopt interface version as lib/getopt.c.
-AC_CHECK_FUNC(_getopt_long_only_r,
-              :,
-              [AC_DEFINE(WANT_INCLUDED_GETOPT,1,
-                         [Define if the included version of getopt has to be 
used])])
-
 AC_SUBST(BACKUP_LIBEXEC_SCRIPTS)
 AC_SUBST(BACKUP_SBIN_SCRIPTS)
 AC_ARG_ENABLE(backup-scripts,
Index: lib/.cvsignore
===================================================================
RCS file: /cvsroot/tar/tar/lib/.cvsignore,v
retrieving revision 1.11
diff -p -u -r1.11 .cvsignore
--- lib/.cvsignore      7 Aug 2004 06:31:20 -0000       1.11
+++ lib/.cvsignore      12 Aug 2004 18:29:21 -0000
@@ -35,6 +35,7 @@ exitfail.h
 fchown-stub.c
 fileblocks.c
 fnmatch.c
+fnmatch.h
 fnmatch_.h
 fnmatch_loop.c
 ftruncate.c
@@ -50,6 +51,7 @@ getndelim2.h
 getopt.c
 getopt.h
 getopt1.c
+getopt_.h
 getopt_int.h
 getpagesize.h
 gettext.h
@@ -103,6 +105,7 @@ strtoll.c
 strtoul.c
 strtoull.c
 strtoumax.c
+sysexit.h
 sysexit_.h
 sysexits.h
 time_r.c
@@ -110,6 +113,7 @@ time_r.h
 timespec.h
 unlocked-io.h
 utime.c
+xalloc-die.c
 xalloc.h
 xgetcwd.c
 xgetcwd.h
Index: src/extract.c
===================================================================
RCS file: /cvsroot/tar/tar/src/extract.c,v
retrieving revision 1.64
diff -p -u -r1.64 extract.c
--- src/extract.c       7 Aug 2004 06:32:12 -0000       1.64
+++ src/extract.c       12 Aug 2004 18:29:21 -0000
@@ -114,7 +114,6 @@ extr_init (void)
   we_are_root = geteuid () == 0;
   same_permissions_option += we_are_root;
   same_owner_option += we_are_root;
-  xalloc_fail_func = extract_finish;
 
   /* Save 'root device' to avoid purging mount points.
      FIXME: Should the same be done after handling -C option ? */
@@ -1210,3 +1209,10 @@ fatal_exit (void)
   error (TAREXIT_FAILURE, 0, _("Error is not recoverable: exiting now"));
   abort ();
 }
+
+void
+xalloc_die (void)
+{
+  error (0, 0, "%s", _("memory exhausted"));
+  fatal_exit ();
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]