pkgsrc-Changes archive

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

CVS commit: pkgsrc/misc/getopt



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Tue May 19 07:57:55 UTC 2026

Modified Files:
        pkgsrc/misc/getopt: distinfo
        pkgsrc/misc/getopt/patches: patch-aa patch-ab patch-gnu_getopt.c
Added Files:
        pkgsrc/misc/getopt/patches: patch-gnu_getopt.h patch-gnu_getopt1.c

Log Message:
getopt: Fix for modern C.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 pkgsrc/misc/getopt/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/misc/getopt/patches/patch-aa
cvs rdiff -u -r1.3 -r1.4 pkgsrc/misc/getopt/patches/patch-ab
cvs rdiff -u -r1.1 -r1.2 pkgsrc/misc/getopt/patches/patch-gnu_getopt.c
cvs rdiff -u -r0 -r1.1 pkgsrc/misc/getopt/patches/patch-gnu_getopt.h \
    pkgsrc/misc/getopt/patches/patch-gnu_getopt1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/misc/getopt/distinfo
diff -u pkgsrc/misc/getopt/distinfo:1.11 pkgsrc/misc/getopt/distinfo:1.12
--- pkgsrc/misc/getopt/distinfo:1.11    Thu May  1 16:58:48 2025
+++ pkgsrc/misc/getopt/distinfo Tue May 19 07:57:55 2026
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.11 2025/05/01 16:58:48 tnn Exp $
+$NetBSD: distinfo,v 1.12 2026/05/19 07:57:55 jperkin Exp $
 
 BLAKE2s (getopt-1.1.6.tar.gz) = d6be5df3bedf765fe4b4e8a287bf8578d2cb22330f1e3016d665cf03ab963754
 SHA512 (getopt-1.1.6.tar.gz) = aa5476e729f33ddd3f32f38b2565da319fdfe034f11549218d5d9953e70dad764e0d9a82bb10efe4043c86ae87f944619b8a2f29a197f592bd855699961d8e10
 Size (getopt-1.1.6.tar.gz) = 58926 bytes
-SHA1 (patch-aa) = 5967a6ec48a7a69078fc1e0fca26645fd9870f77
-SHA1 (patch-ab) = 8591f15916b47d3569c79639e6ee9aa82df07f6a
-SHA1 (patch-gnu_getopt.c) = f27194128abce7901232a5d24cdcab225af369d2
+SHA1 (patch-aa) = 6062d6b15990142ba8d5556eb0588f948674b4ae
+SHA1 (patch-ab) = bd00147c65577de29cd935a714b8ae0852bff0fb
+SHA1 (patch-gnu_getopt.c) = caae6177c2c70d5dcd764e7299135a6efb410d73
+SHA1 (patch-gnu_getopt.h) = 3d8c015786c6e4b451efc7cd294977250a05df9d
+SHA1 (patch-gnu_getopt1.c) = fc22b9f5778fa2ea8953c028991455937d3c8e91

Index: pkgsrc/misc/getopt/patches/patch-aa
diff -u pkgsrc/misc/getopt/patches/patch-aa:1.2 pkgsrc/misc/getopt/patches/patch-aa:1.3
--- pkgsrc/misc/getopt/patches/patch-aa:1.2     Thu Apr 11 11:45:44 2013
+++ pkgsrc/misc/getopt/patches/patch-aa Tue May 19 07:57:55 2026
@@ -1,4 +1,6 @@
-$NetBSD: patch-aa,v 1.2 2013/04/11 11:45:44 adam Exp $
+$NetBSD: patch-aa,v 1.3 2026/05/19 07:57:55 jperkin Exp $
+
+Add missing includes.
 
 --- getopt.c.orig      2003-01-23 21:51:24.000000000 +0100
 +++ getopt.c

Index: pkgsrc/misc/getopt/patches/patch-ab
diff -u pkgsrc/misc/getopt/patches/patch-ab:1.3 pkgsrc/misc/getopt/patches/patch-ab:1.4
--- pkgsrc/misc/getopt/patches/patch-ab:1.3     Fri Apr 12 22:26:44 2013
+++ pkgsrc/misc/getopt/patches/patch-ab Tue May 19 07:57:55 2026
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.3 2013/04/12 22:26:44 drochner Exp $
+$NetBSD: patch-ab,v 1.4 2026/05/19 07:57:55 jperkin Exp $
+
+Use pkgsrc layout.
 
 --- Makefile.orig      2012-08-12 09:07:43.000000000 +0000
 +++ Makefile

Index: pkgsrc/misc/getopt/patches/patch-gnu_getopt.c
diff -u pkgsrc/misc/getopt/patches/patch-gnu_getopt.c:1.1 pkgsrc/misc/getopt/patches/patch-gnu_getopt.c:1.2
--- pkgsrc/misc/getopt/patches/patch-gnu_getopt.c:1.1   Thu May  1 16:58:48 2025
+++ pkgsrc/misc/getopt/patches/patch-gnu_getopt.c       Tue May 19 07:57:55 2026
@@ -1,8 +1,9 @@
-$NetBSD: patch-gnu_getopt.c,v 1.1 2025/05/01 16:58:48 tnn Exp $
+$NetBSD: patch-gnu_getopt.c,v 1.2 2026/05/19 07:57:55 jperkin Exp $
 
 * Include <string.h> for strlen(3)
+* Fix for modern C.
 
---- gnu/getopt.c.orig  2025-05-01 16:57:05.278129342 +0000
+--- gnu/getopt.c.orig  2014-11-19 21:39:47.000000000 +0000
 +++ gnu/getopt.c
 @@ -40,6 +40,7 @@
  #endif
@@ -12,3 +13,84 @@ $NetBSD: patch-gnu_getopt.c,v 1.1 2025/0
  
  /* Comment out all this code if we are using the GNU C Library, and are not
     actually compiling the library itself.  This code is part of the GNU C
+@@ -207,12 +208,10 @@ static char *posixly_correct;
+ /* Avoid depending on library functions or files
+    whose names are inconsistent.  */
+ 
+-char *getenv ();
++char *getenv (const char *);
+ 
+ static char *
+-my_index (str, chr)
+-     const char *str;
+-     int chr;
++my_index (const char *str, int chr)
+ {
+   while (*str)
+     {
+@@ -300,8 +299,7 @@ static void exchange (char **);
+ #endif
+ 
+ static void
+-exchange (argv)
+-     char **argv;
++exchange (char **argv)
+ {
+   int bottom = first_nonopt;
+   int middle = last_nonopt;
+@@ -385,10 +383,7 @@ exchange (argv)
+ static const char *_getopt_initialize (int, char *const *, const char *);
+ #endif
+ static const char *
+-_getopt_initialize (argc, argv, optstring)
+-     int argc;
+-     char *const *argv;
+-     const char *optstring;
++_getopt_initialize (int argc, char *const *argv, const char *optstring)
+ {
+   /* Start processing options with ARGV-element 1 (since ARGV-element 0
+      is the program name); the sequence of previously skipped
+@@ -510,13 +505,7 @@ _getopt_initialize (argc, argv, optstrin
+    long-named options.  */
+ 
+ int
+-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+-     int argc;
+-     char *const *argv;
+-     const char *optstring;
+-     const struct option *longopts;
+-     int *longind;
+-     int long_only;
++_getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only)
+ {
+   optarg = NULL;
+ 
+@@ -695,7 +684,7 @@ _getopt_internal (argc, argv, optstring,
+               optarg = nameend + 1;
+             else
+               {
+-                if (opterr)
++                if (opterr) {
+                  if (argv[optind - 1][1] == '-')
+                   /* --option */
+                   fprintf (stderr,
+@@ -706,6 +695,7 @@ _getopt_internal (argc, argv, optstring,
+                   fprintf (stderr,
+                    _("%s: option `%c%s' doesn't allow an argument\n"),
+                    argv[0], argv[optind - 1][0], pfound->name);
++                }
+ 
+                 nextchar += strlen (nextchar);
+ 
+@@ -964,10 +954,7 @@ _getopt_internal (argc, argv, optstring,
+ }
+ 
+ int
+-getopt (argc, argv, optstring)
+-     int argc;
+-     char *const *argv;
+-     const char *optstring;
++getopt (int argc, char *const *argv, const char *optstring)
+ {
+   return _getopt_internal (argc, argv, optstring,
+                          (const struct option *) 0,

Added files:

Index: pkgsrc/misc/getopt/patches/patch-gnu_getopt.h
diff -u /dev/null pkgsrc/misc/getopt/patches/patch-gnu_getopt.h:1.1
--- /dev/null   Tue May 19 07:57:55 2026
+++ pkgsrc/misc/getopt/patches/patch-gnu_getopt.h       Tue May 19 07:57:55 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-gnu_getopt.h,v 1.1 2026/05/19 07:57:55 jperkin Exp $
+
+Fix for modern C.
+
+--- gnu/getopt.h.orig  2026-05-19 07:33:46.925838527 +0000
++++ gnu/getopt.h
+@@ -103,7 +103,7 @@ struct option
+    errors, only prototype getopt for the GNU C library.  */
+ extern int getopt (int argc, char *const *argv, const char *shortopts);
+ #else /* not __GNU_LIBRARY__ */
+-extern int getopt ();
++extern int getopt (int, char *const *, const char *);
+ #endif /* __GNU_LIBRARY__ */
+ extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+                       const struct option *longopts, int *longind);
Index: pkgsrc/misc/getopt/patches/patch-gnu_getopt1.c
diff -u /dev/null pkgsrc/misc/getopt/patches/patch-gnu_getopt1.c:1.1
--- /dev/null   Tue May 19 07:57:55 2026
+++ pkgsrc/misc/getopt/patches/patch-gnu_getopt1.c      Tue May 19 07:57:55 2026
@@ -0,0 +1,34 @@
+$NetBSD: patch-gnu_getopt1.c,v 1.1 2026/05/19 07:57:55 jperkin Exp $
+
+Fix for modern C.
+
+--- gnu/getopt1.c.orig 2026-05-19 07:36:43.996213093 +0000
++++ gnu/getopt1.c
+@@ -63,12 +63,7 @@
+ #endif
+ 
+ int
+-getopt_long (argc, argv, options, long_options, opt_index)
+-     int argc;
+-     char *const *argv;
+-     const char *options;
+-     const struct option *long_options;
+-     int *opt_index;
++getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index)
+ {
+   return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+ }
+@@ -79,12 +74,7 @@ getopt_long (argc, argv, options, long_o
+    instead.  */
+ 
+ int
+-getopt_long_only (argc, argv, options, long_options, opt_index)
+-     int argc;
+-     char *const *argv;
+-     const char *options;
+-     const struct option *long_options;
+-     int *opt_index;
++getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index)
+ {
+   return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+ }



Home | Main Index | Thread Index | Old Index