findutils-patches
[Top][All Lists]
Advanced

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

Re: [Findutils-patches] Fwd: human interface change?!? [Re: xstrtol.h


From: Eric Blake
Subject: Re: [Findutils-patches] Fwd: human interface change?!? [Re: xstrtol.h
Date: Mon, 20 Aug 2007 07:20:12 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 8/11/2007 7:51 AM:
>> Right you are, on both points.  Here's a revised patch for findutils.
>> You might want to adjust the indentation of the 'for' loop after the
>> patch.
> 
>> 2007-08-10  Paul Eggert  <address@hidden>
> 
>>         * locate/locate.c (dolocate): Adjust to API change of
>>         xstrtol gnulib module.
>>         * po/POTFILES.in: Likewise.
> 
> Looks okay to me, except that it also requires updating
> import-gnulib.config to require 2007-08-11 or later rather than 2007-07-07.

There have been no further comments, so I went ahead and applied this
patch to 4.3.x as follows.  I'm still debating whether to update 4.2.x to
the latest gnulib, as there are several API changes in gnulib since
February that would need other touchups; one argument for making the
upgrade would be the ability to fix the POSIX compliance bug 20273.

2007-08-20  Paul Eggert  <address@hidden>
        and Eric Blake  <address@hidden>

        Improve translation of xstrtol messages.
        * import-gnulib.config (destdir): Upgrade gnulib to 2007-08-11.
        * locate/locate.c (dolocate): Adjust to API change of xstrtol
        gnulib module.
        * po/POTFILES.in: Likewise.
        * NEWS: Document the enhancement.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGyZUL84KuGfSFAYARAhivAJ4wHxe3w9wZRtnvqIcLTi1YjwMnNACcD7F3
Uq+ZpBjTQLo4mNafsP5p6S8=
=Y1gW
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.201
diff -u -p -r1.201 NEWS
--- NEWS        19 Aug 2007 15:31:38 -0000      1.201
+++ NEWS        20 Aug 2007 13:19:14 -0000
@@ -39,8 +39,10 @@ since 4.3.1.
 and find at ./configure time.
 
 #20688: The warning printed by -name or -iname when the pattern to
- match contains a slash can now be silenced by -nowarn.  This warning
- was originally introduced unconditionally in 4.2.21.
+match contains a slash can now be silenced by -nowarn.  This warning
+was originally introduced unconditionally in 4.2.21.
+
+Translation of locate --limit problems is improved.
 
 ** Documentation Fixes
 
Index: import-gnulib.config
===================================================================
RCS file: /sources/findutils/findutils/import-gnulib.config,v
retrieving revision 1.23
diff -u -p -r1.23 import-gnulib.config
--- import-gnulib.config        22 Jul 2007 13:08:21 -0000      1.23
+++ import-gnulib.config        20 Aug 2007 13:19:14 -0000
@@ -1,7 +1,7 @@
 # findutils gnulib.config -*- sh -*-
 
 # What version of gnulib to use?
-gnulib_version="2007-07-07"
+gnulib_version="2007-08-11"
 
 destdir="gnulib"
 
Index: locate/locate.c
===================================================================
RCS file: /sources/findutils/findutils/locate/locate.c,v
retrieving revision 1.89
diff -u -p -r1.89 locate.c
--- locate/locate.c     5 Aug 2007 12:22:14 -0000       1.89
+++ locate/locate.c     20 Aug 2007 13:19:14 -0000
@@ -1566,7 +1566,6 @@ dolocate (int argc, char **argv, int sec
 {
   char *dbpath;
   unsigned long int found = 0uL;
-  int optc;
   int ignore_case = 0;
   int print = 0;
   int just_count = 0;
@@ -1608,113 +1607,120 @@ dolocate (int argc, char **argv, int sec
 
   check_existence = ACCEPT_EITHER;
 
-  while ((optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts, 
(int *) 0)) != -1)
-    switch (optc)
-      {
-      case '0':
-       separator = 0;
-       print_quoted_filename = false; /* print filename 'raw'. */
-       break;
-
-      case 'A':
-       op_and = 1;
-       break;
-
-      case 'b':
-       basename_only = 1;
-       break;
-
-      case 'c':
-       just_count = 1;
-       break;
-
-      case 'd':
-       dbpath = optarg;
-       they_chose_db = 1;
-       break;
-
-      case 'e':
-       check_existence = ACCEPT_EXISTING;
-       break;
-
-      case 'E':
-       check_existence = ACCEPT_NON_EXISTING;
-       break;
-
-      case 'i':
-       ignore_case = 1;
-       break;
-       
-      case 'h':
-       usage (stdout);
-       return 0;
-
-      case MAX_DB_AGE:
-       /* XXX: nothing in the test suite for this option. */
-       set_max_db_age(optarg);
-       break;
-
-      case 'p':
-       print = 1;
+  for (;;)
+    {
+      int opti = -1;
+      int optc = getopt_long (argc, argv, "Abcd:eEil:prsm0SwHPL", longopts,
+                             &opti);
+      if (optc == -1)
        break;
 
-      case 'v':
-       display_findutils_version("locate");
-       return 0;
-
-      case 'w':
-       basename_only = 0;
-       break;
+      switch (optc)
+       {
+       case '0':
+         separator = 0;
+         print_quoted_filename = false; /* print filename 'raw'. */
+         break;
+
+       case 'A':
+         op_and = 1;
+         break;
+
+       case 'b':
+         basename_only = 1;
+         break;
+
+       case 'c':
+         just_count = 1;
+         break;
+
+       case 'd':
+         dbpath = optarg;
+         they_chose_db = 1;
+         break;
+
+       case 'e':
+         check_existence = ACCEPT_EXISTING;
+         break;
+
+       case 'E':
+         check_existence = ACCEPT_NON_EXISTING;
+         break;
+
+       case 'i':
+         ignore_case = 1;
+         break;
 
-      case 'r':
-       regex = 1;
-       break;
+       case 'h':
+         usage (stdout);
+         return 0;
 
-      case REGEXTYPE_OPTION:
-       regex_options = get_regex_type(optarg);
-       break;
-       
-      case 'S':
-       stats = 1;
-       break;
+       case MAX_DB_AGE:
+         /* XXX: nothing in the test suite for this option. */
+         set_max_db_age (optarg);
+         break;
+
+       case 'p':
+         print = 1;
+         break;
 
-      case 'L':
-       follow_symlinks = 1;
-       break;
+       case 'v':
+         display_findutils_version ("locate");
+         return 0;
 
-       /* In find, -P and -H differ in the way they handle paths
-        * given on the command line.  This is not relevant for
-        * locate, but the -H option is supported because it is
-        * probably more intuitive to do so.
-        */
-      case 'P':
-      case 'H':
-       follow_symlinks = 0;
-       break;
+       case 'w':
+         basename_only = 0;
+         break;
+
+       case 'r':
+         regex = 1;
+         break;
+
+       case REGEXTYPE_OPTION:
+         regex_options = get_regex_type (optarg);
+         break;
+
+       case 'S':
+         stats = 1;
+         break;
+
+       case 'L':
+         follow_symlinks = 1;
+         break;
+
+         /* In find, -P and -H differ in the way they handle paths
+          * given on the command line.  This is not relevant for
+          * locate, but the -H option is supported because it is
+          * probably more intuitive to do so.
+          */
+       case 'P':
+       case 'H':
+         follow_symlinks = 0;
+         break;
+
+       case 'l':
+         {
+           char *end = optarg;
+           strtol_error err = xstrtoumax (optarg, &end, 10, &limits.limit,
+                                          NULL);
+           if (LONGINT_OK != err)
+             xstrtol_fatal (err, opti, optc, longopts, optarg);
+           use_limit = 1;
+         }
+         break;
+
+       case 's':                       /* use stdio */
+       case 'm':                       /* use mmap  */
+         /* These options are implemented simply for
+          * compatibility with FreeBSD
+          */
+         break;
 
-      case 'l':
-       {
-         char *end = optarg;
-         strtol_error err = xstrtoumax(optarg, &end, 10, &limits.limit, NULL);
-         if (LONGINT_OK != err)
-           {
-             STRTOL_FATAL_ERROR(optarg, _("argument to --limit"), err);
-           }
-         use_limit = 1;
+       default:
+         usage (stderr);
+         return 1;
        }
-       break;
-
-      case 's':                        /* use stdio */
-      case 'm':                        /* use mmap  */
-       /* These options are implemented simply for
-        * compatibility with FreeBSD
-        */ 
-       break;
-
-      default:
-       usage (stderr);
-       return 1;
-      }
+    }
 
 
   /* If the user gave the -d option or set LOCATE_PATH,
Index: po/POTFILES.in
===================================================================
RCS file: /sources/findutils/findutils/po/POTFILES.in,v
retrieving revision 1.6
diff -u -p -r1.6 POTFILES.in
--- po/POTFILES.in      23 Jul 2007 02:55:17 -0000      1.6
+++ po/POTFILES.in      20 Aug 2007 13:19:14 -0000
@@ -1,5 +1,9 @@
 # List of source files containing translatable strings.
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+
+# Copying and distribution of this file, with or without
+# modification, are permitted provided the copyright notice
+# and this notice are preserved.
 
 # Common library files
 gnulib/lib/argmatch.c
@@ -14,7 +18,7 @@ gnulib/lib/quotearg.c
 gnulib/lib/regcomp.c
 gnulib/lib/rpmatch.c
 gnulib/lib/xalloc-die.c
-gnulib/lib/xstrtol.h
+gnulib/lib/xstrtol-error.c
 
 #Package source files
 find/find.c

reply via email to

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