pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files 20080915:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/10b44566cc90
branches:  trunk
changeset: 547413:10b44566cc90
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Sep 16 13:32:58 2008 +0000

description:
20080915:
Merge a number of bugfixes from the pkg_install-renovation branch:
- explicit include of nbcompat/md5.h
- use errx when dealing with libfetch as it doesn't set errno
- avoid optind = 0 as GNUish getopt will reset itself otherwise

diffstat:

 pkgtools/pkg_install/files/admin/audit.c   |  24 ++++++++++++++++++------
 pkgtools/pkg_install/files/admin/check.c   |   8 +++++---
 pkgtools/pkg_install/files/admin/main.c    |   8 +++++---
 pkgtools/pkg_install/files/configure       |   3 +--
 pkgtools/pkg_install/files/configure.ac    |   2 +-
 pkgtools/pkg_install/files/create/pl.c     |   8 +++++---
 pkgtools/pkg_install/files/lib/config.h.in |   9 +++------
 pkgtools/pkg_install/files/lib/plist.c     |   8 +++++---
 pkgtools/pkg_install/files/lib/version.h   |   4 ++--
 9 files changed, 45 insertions(+), 29 deletions(-)

diffs (260 lines):

diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/admin/audit.c
--- a/pkgtools/pkg_install/files/admin/audit.c  Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/audit.c  Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audit.c,v 1.8 2008/04/16 00:53:06 joerg Exp $  */
+/*     $NetBSD: audit.c,v 1.9 2008/09/16 13:32:58 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 2008/04/16 00:53:06 joerg Exp $");
+__RCSID("$NetBSD: audit.c,v 1.9 2008/09/16 13:32:58 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
@@ -348,17 +357,20 @@
 
        f = fetchXGetURL(pkg_vulnerabilities_url, &st, "");
        if (f == NULL)
-               err(EXIT_FAILURE, "Could not fetch vulnerability file");
+               errx(EXIT_FAILURE, "Could not fetch vulnerability file: %s",
+                   fetchLastErrString);
 
        if (st.size > SSIZE_MAX - 1)
-               err(EXIT_FAILURE, "pkg-vulnerabilities is too large");
+               errx(EXIT_FAILURE, "pkg-vulnerabilities is too large");
 
        buf_len = st.size;
        if ((buf = malloc(buf_len + 1)) == NULL)
                err(EXIT_FAILURE, "malloc failed");
 
        if (fetchIO_read(f, buf, buf_len) != buf_len)
-               err(EXIT_FAILURE, "Failure during fetch of pkg-vulnerabilities");
+               errx(EXIT_FAILURE,
+                   "Failure during fetch of pkg-vulnerabilities: %s",
+                   fetchLastErrString);
        buf[buf_len] = '\0';
 
        if (decompress_buffer(buf, buf_len, &decompressed_input,
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/admin/check.c
--- a/pkgtools/pkg_install/files/admin/check.c  Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/check.c  Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: check.c,v 1.3 2008/04/29 05:46:08 martin Exp $ */
+/*     $NetBSD: check.c,v 1.4 2008/09/16 13:32:58 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: check.c,v 1.3 2008/04/29 05:46:08 martin Exp $");
+__RCSID("$NetBSD: check.c,v 1.4 2008/09/16 13:32:58 joerg Exp $");
 #endif
 
 /*-
@@ -58,7 +58,9 @@
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
 #include <md5.h>
 #endif
 #if HAVE_LIMITS_H
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.43 2008/04/29 05:46:08 martin Exp $ */
+/*     $NetBSD: main.c,v 1.44 2008/09/16 13:32:58 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.43 2008/04/29 05:46:08 martin Exp $");
+__RCSID("$NetBSD: main.c,v 1.44 2008/09/16 13:32:58 joerg Exp $");
 #endif
 
 /*-
@@ -59,7 +59,9 @@
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
 #include <md5.h>
 #endif
 #if HAVE_LIMITS_H
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/configure
--- a/pkgtools/pkg_install/files/configure      Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/configure      Tue Sep 16 13:32:58 2008 +0000
@@ -4625,9 +4625,8 @@
 
 
 
-
 for ac_header in assert.h ctype.h dirent.h err.h errno.h fnctl.h \
-       fnmatch.h glob.h grp.h inttypes.h limits.h md5.h netdb.h \
+       fnmatch.h glob.h grp.h inttypes.h limits.h netdb.h \
        pwd.h regex.h signal.h stdarg.h stdio.h stdlib.h string.h \
        termcap.h termios.h time.h unistd.h vis.h
 do
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/configure.ac
--- a/pkgtools/pkg_install/files/configure.ac   Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/configure.ac   Tue Sep 16 13:32:58 2008 +0000
@@ -74,7 +74,7 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([assert.h ctype.h dirent.h err.h errno.h fnctl.h \
-       fnmatch.h glob.h grp.h inttypes.h limits.h md5.h netdb.h \
+       fnmatch.h glob.h grp.h inttypes.h limits.h netdb.h \
        pwd.h regex.h signal.h stdarg.h stdio.h stdlib.h string.h \
        termcap.h termios.h time.h unistd.h vis.h])
 AC_CHECK_HEADERS([db1/db.h db_185.h db.h])
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/create/pl.c
--- a/pkgtools/pkg_install/files/create/pl.c    Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/create/pl.c    Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl.c,v 1.10 2007/08/03 13:15:59 joerg Exp $    */
+/*     $NetBSD: pl.c,v 1.11 2008/09/16 13:32:58 joerg Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp";
 #else
-__RCSID("$NetBSD: pl.c,v 1.10 2007/08/03 13:15:59 joerg Exp $");
+__RCSID("$NetBSD: pl.c,v 1.11 2008/09/16 13:32:58 joerg Exp $");
 #endif
 #endif
 
@@ -40,7 +40,9 @@
 #if HAVE_ERR_H
 #include <err.h>
 #endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
 #include <md5.h>
 #endif
 
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/lib/config.h.in
--- a/pkgtools/pkg_install/files/lib/config.h.in        Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/config.h.in        Tue Sep 16 13:32:58 2008 +0000
@@ -54,9 +54,6 @@
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
-/* Define to 1 if you have the <md5.h> header file. */
-#undef HAVE_MD5_H
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -196,17 +193,17 @@
 #undef STDC_HEADERS
 
 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT32_T
 
 /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT64_T
 
 /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
-   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
 #undef _UINT8_T
 
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/lib/plist.c
--- a/pkgtools/pkg_install/files/lib/plist.c    Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/plist.c    Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: plist.c,v 1.19 2008/04/26 17:40:01 joerg Exp $ */
+/*     $NetBSD: plist.c,v 1.20 2008/09/16 13:32:58 joerg Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp";
 #else
-__RCSID("$NetBSD: plist.c,v 1.19 2008/04/26 17:40:01 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.20 2008/09/16 13:32:58 joerg Exp $");
 #endif
 #endif
 
@@ -71,7 +71,9 @@
 #if HAVE_ERR_H
 #include <err.h>
 #endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
 #include <md5.h>
 #endif
 
diff -r 1d0a125661ed -r 10b44566cc90 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Tue Sep 16 13:31:26 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Tue Sep 16 13:32:58 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.103 2008/05/08 15:30:38 wiz Exp $        */
+/*     $NetBSD: version.h,v 1.104 2008/09/16 13:32:58 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 "20080423"
+#define PKGTOOLS_VERSION "20080915"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index