summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-09-16 13:32:58 +0000
committerjoerg <joerg@pkgsrc.org>2008-09-16 13:32:58 +0000
commit76d159ee1e97c06ee6a6a059b46105ccc88d02a2 (patch)
treec9cbfc0832cdf1d140878c7051dcd723ea6b067b /pkgtools
parente83d1a542a7bca4f88a354b6a6d7dd8971d83acf (diff)
downloadpkgsrc-76d159ee1e97c06ee6a6a059b46105ccc88d02a2.tar.gz
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 (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/admin/audit.c24
-rw-r--r--pkgtools/pkg_install/files/admin/check.c8
-rw-r--r--pkgtools/pkg_install/files/admin/main.c8
-rwxr-xr-xpkgtools/pkg_install/files/configure3
-rw-r--r--pkgtools/pkg_install/files/configure.ac2
-rw-r--r--pkgtools/pkg_install/files/create/pl.c8
-rw-r--r--pkgtools/pkg_install/files/lib/config.h.in9
-rw-r--r--pkgtools/pkg_install/files/lib/plist.c8
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
9 files changed, 45 insertions, 29 deletions
diff --git a/pkgtools/pkg_install/files/admin/audit.c b/pkgtools/pkg_install/files/admin/audit.c
index 6707c5873ca..67eb1222810 100644
--- a/pkgtools/pkg_install/files/admin/audit.c
+++ b/pkgtools/pkg_install/files/admin/audit.c
@@ -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 @@ parse_options(int argc, char **argv)
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 @@ parse_options(int argc, char **argv)
/* NOTREACHED */
}
}
+
+ --optind; /* See above comment. */
}
static int
@@ -348,17 +357,20 @@ fetch_pkg_vulnerabilities(int argc, char **argv)
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 --git a/pkgtools/pkg_install/files/admin/check.c b/pkgtools/pkg_install/files/admin/check.c
index 912f29eb484..9d69eaa0870 100644
--- a/pkgtools/pkg_install/files/admin/check.c
+++ b/pkgtools/pkg_install/files/admin/check.c
@@ -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 @@ __RCSID("$NetBSD: check.c,v 1.3 2008/04/29 05:46:08 martin Exp $");
#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 --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index c9346216508..439d32c7046 100644
--- a/pkgtools/pkg_install/files/admin/main.c
+++ b/pkgtools/pkg_install/files/admin/main.c
@@ -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 @@ __RCSID("$NetBSD: main.c,v 1.43 2008/04/29 05:46:08 martin Exp $");
#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 --git a/pkgtools/pkg_install/files/configure b/pkgtools/pkg_install/files/configure
index 43d594bac40..7fb6f8fe2d1 100755
--- a/pkgtools/pkg_install/files/configure
+++ b/pkgtools/pkg_install/files/configure
@@ -4625,9 +4625,8 @@ done
-
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 --git a/pkgtools/pkg_install/files/configure.ac b/pkgtools/pkg_install/files/configure.ac
index b9c25b4b8d4..8881e5e568b 100644
--- a/pkgtools/pkg_install/files/configure.ac
+++ b/pkgtools/pkg_install/files/configure.ac
@@ -74,7 +74,7 @@ AC_SEARCH_LIBS(tgetent, [termcap termlib curses ncurses])
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 --git a/pkgtools/pkg_install/files/create/pl.c b/pkgtools/pkg_install/files/create/pl.c
index 02886dabe99..6323bdba9fc 100644
--- a/pkgtools/pkg_install/files/create/pl.c
+++ b/pkgtools/pkg_install/files/create/pl.c
@@ -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 @@ __RCSID("$NetBSD: pl.c,v 1.10 2007/08/03 13:15:59 joerg Exp $");
#if HAVE_ERR_H
#include <err.h>
#endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
#include <md5.h>
#endif
diff --git a/pkgtools/pkg_install/files/lib/config.h.in b/pkgtools/pkg_install/files/lib/config.h.in
index f662a6f1994..3a32b2fda26 100644
--- a/pkgtools/pkg_install/files/lib/config.h.in
+++ b/pkgtools/pkg_install/files/lib/config.h.in
@@ -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 --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c
index 0b24734012d..c0df04b36ca 100644
--- a/pkgtools/pkg_install/files/lib/plist.c
+++ b/pkgtools/pkg_install/files/lib/plist.c
@@ -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 @@ __RCSID("$NetBSD: plist.c,v 1.19 2008/04/26 17:40:01 joerg Exp $");
#if HAVE_ERR_H
#include <err.h>
#endif
-#if HAVE_MD5_H
+#ifndef NETBSD
+#include <nbcompat/md5.h>
+#else
#include <md5.h>
#endif
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 050f4b71ced..cffe0d0d1de 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -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_ */