pkgsrc-Changes-HG archive

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

[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install/files pkg_instal...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5e4772badd8b
branches:  pkg_install-renovation
changeset: 541568:5e4772badd8b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Jul 27 16:22:53 2008 +0000

description:
pkg_install-20080727:
When using the libnbcompat version of getopt, make sure to not use
optind = 0. For GNU getopt compatibility, it does a partial reset.
This fixes PR 39181.

diffstat:

 pkgtools/pkg_install/files/admin/audit.c |  15 ++++++++++++---
 pkgtools/pkg_install/files/lib/version.h |   4 ++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (60 lines):

diff -r 24ec297bfc01 -r 5e4772badd8b pkgtools/pkg_install/files/admin/audit.c
--- a/pkgtools/pkg_install/files/admin/audit.c  Wed Jul 23 18:59:18 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/audit.c  Sun Jul 27 16:22:53 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audit.c,v 1.8.2.1 2008/05/12 12:12:07 joerg Exp $      */
+/*     $NetBSD: audit.c,v 1.8.2.2 2008/07/27 16:22:53 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: audit.c,v 1.8.2.1 2008/05/12 12:12:07 joerg Exp $");
+__RCSID("$NetBSD: audit.c,v 1.8.2.2 2008/07/27 16:22:53 joerg Exp $");
 #endif
 
 /*-
@@ -87,7 +87,14 @@
        int ch;
 
        optreset = 1;
-       optind = 0;
+       /*
+        * optind == 0 is interpreted as partial reset request
+        * by GNU getopt, so compensate against this and cleanup
+        * at the end.
+        */
+       optind = 1;
+       ++argc;
+       --argv;
 
        while ((ch = getopt(argc, argv, "est:")) != -1) {
                switch (ch) {
@@ -105,6 +112,8 @@
                        /* NOTREACHED */
                }
        }
+
+       --optind; /* See above comment. */
 }
 
 static int
diff -r 24ec297bfc01 -r 5e4772badd8b pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Wed Jul 23 18:59:18 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Sun Jul 27 16:22:53 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.102.2.9 2008/07/18 19:48:41 joerg Exp $  */
+/*     $NetBSD: version.h,v 1.102.2.10 2008/07/27 16:22:53 joerg Exp $ */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20080718"
+#define PKGTOOLS_VERSION "20080727"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index