Source-Changes-HG archive

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

[src/netbsd-3]: src/usr.sbin/pkg_install Pull up following revision(s) (reque...



details:   https://anonhg.NetBSD.org/src/rev/2abd33388334
branches:  netbsd-3
changeset: 577454:2abd33388334
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 06 13:43:17 2005 +0000

description:
Pull up following revision(s) (requested by wiz in ticket #938):
        usr.sbin/pkg_install/lib/pen.c: revision 1.35
        usr.sbin/pkg_install/lib/lib.h: revision 1.78
        usr.sbin/pkg_install/info/show.c: revision 1.33
        usr.sbin/pkg_install/info/main.c: revision 1.47
        usr.sbin/pkg_install/lib/pkgdb.c: revision 1.22
        usr.sbin/pkg_install/admin/main.c: revision 1.50
        usr.sbin/pkg_install/lib/plist.c: revision 1.50
        usr.sbin/pkg_install/create/perform.c: revision 1.41
        usr.sbin/pkg_install/lib/version.c: revision 1.2
        usr.sbin/pkg_install/lib/fexec.c: revision 1.8
        usr.sbin/pkg_install/lib/file.c: revision 1.74
        usr.sbin/pkg_install/lib/ftpio.c: revision 1.69
        usr.sbin/pkg_install/lib/nbcompat.h: revision 1.1
        usr.sbin/pkg_install/create/main.c: revision 1.28
        usr.sbin/pkg_install/lib/global.c: revision 1.7
        usr.sbin/pkg_install/add/futil.c: revision 1.15
        usr.sbin/pkg_install/info/perform.c: revision 1.64
        usr.sbin/pkg_install/lib/defs.h: revision 1.2
        usr.sbin/pkg_install/add/perform.c: revision 1.113
        usr.sbin/pkg_install/lib/path.c: revision 1.8
        usr.sbin/pkg_install/delete/perform.c: revision 1.57
        usr.sbin/pkg_install/add/extract.c: revision 1.36
        usr.sbin/pkg_install/Makefile.inc: revision 1.26
        usr.sbin/pkg_install/lib/config.h: revision 1.1
        usr.sbin/pkg_install/delete/main.c: revision 1.35
        usr.sbin/pkg_install/create/pl.c: revision 1.33
        usr.sbin/pkg_install/lib/str.c: revision 1.56
        usr.sbin/pkg_install/add/verify.c: revision 1.7
        usr.sbin/pkg_install/add/main.c: revision 1.36
        usr.sbin/pkg_install/lib/lpkg.c: revision 1.6
Add compat #ifdefs from pkgsrc, to make syncing easier between the
two versions.

diffstat:

 usr.sbin/pkg_install/Makefile.inc     |    3 +-
 usr.sbin/pkg_install/add/extract.c    |   16 ++-
 usr.sbin/pkg_install/add/futil.c      |   12 +-
 usr.sbin/pkg_install/add/main.c       |   16 ++-
 usr.sbin/pkg_install/add/perform.c    |   46 +++++++-
 usr.sbin/pkg_install/add/verify.c     |   32 ++++-
 usr.sbin/pkg_install/admin/main.c     |   30 ++++-
 usr.sbin/pkg_install/create/main.c    |   12 +-
 usr.sbin/pkg_install/create/perform.c |   18 ++-
 usr.sbin/pkg_install/create/pl.c      |   14 ++-
 usr.sbin/pkg_install/delete/main.c    |   12 +-
 usr.sbin/pkg_install/delete/perform.c |   14 ++-
 usr.sbin/pkg_install/info/main.c      |   16 ++-
 usr.sbin/pkg_install/info/perform.c   |   22 +++-
 usr.sbin/pkg_install/info/show.c      |   12 +-
 usr.sbin/pkg_install/lib/config.h     |  193 ++++++++++++++++++++++++++++++++++
 usr.sbin/pkg_install/lib/defs.h       |   12 +-
 usr.sbin/pkg_install/lib/fexec.c      |   20 +++-
 usr.sbin/pkg_install/lib/file.c       |   26 ++++-
 usr.sbin/pkg_install/lib/ftpio.c      |   47 +++++++-
 usr.sbin/pkg_install/lib/global.c     |   10 +-
 usr.sbin/pkg_install/lib/lib.h        |   28 ++++-
 usr.sbin/pkg_install/lib/lpkg.c       |    8 +-
 usr.sbin/pkg_install/lib/path.c       |   12 +-
 usr.sbin/pkg_install/lib/pen.c        |   18 ++-
 usr.sbin/pkg_install/lib/pkgdb.c      |   41 ++++++-
 usr.sbin/pkg_install/lib/plist.c      |   16 ++-
 usr.sbin/pkg_install/lib/str.c        |   16 ++-
 usr.sbin/pkg_install/lib/version.c    |   12 +-
 29 files changed, 679 insertions(+), 55 deletions(-)

diffs (truncated from 1413 to 300 lines):

diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/Makefile.inc
--- a/usr.sbin/pkg_install/Makefile.inc Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/Makefile.inc Sun Nov 06 13:43:17 2005 +0000
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.25 2003/09/23 05:39:41 grant Exp $
+# $NetBSD: Makefile.inc,v 1.25.6.1 2005/11/06 13:43:18 tron Exp $
 # Original from FreeBSD, no rcs id.
 
 .include <bsd.own.mk>
 
 LIBINSTALL != cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
 CPPFLAGS+=-I${.CURDIR}/../lib ${DEBUG} -DBINDIR='"${BINDIR}"'
+CPPFLAGS+=-DHAVE_CONFIG_H
 
 # UNDER NO CIRCUMSTANCES SHOULD THIS MAKEFILE TEST THE OUTPUT OF uname!!
 # DOING SO BREAKS CROSS COMPILING.
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/add/extract.c
--- a/usr.sbin/pkg_install/add/extract.c        Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/add/extract.c        Sun Nov 06 13:43:17 2005 +0000
@@ -1,11 +1,17 @@
-/*     $NetBSD: extract.c,v 1.34.2.1 2005/07/30 17:35:09 tron Exp $    */
+/*     $NetBSD: extract.c,v 1.34.2.2 2005/11/06 13:43:18 tron Exp $    */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 #ifndef lint
 #if 0
 static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp";
 #else
-__RCSID("$NetBSD: extract.c,v 1.34.2.1 2005/07/30 17:35:09 tron Exp $");
+__RCSID("$NetBSD: extract.c,v 1.34.2.2 2005/11/06 13:43:18 tron Exp $");
 #endif
 #endif
 
@@ -29,7 +35,9 @@
  *
  */
 
+#if HAVE_ERR_H
 #include <err.h>
+#endif
 #include "lib.h"
 #include "add.h"
 
@@ -80,7 +88,9 @@
                if (q->type == PLIST_FILE) {
                        (void) snprintf(try, sizeof(try), "%s/%s", dir, q->name);
                        if (make_preserve_name(bup, sizeof(bup), name, try) && fexists(bup)) {
+#if HAVE_CHFLAGS
                                (void) chflags(try, 0);
+#endif
                                (void) unlink(try);
                                if (rename(bup, try))
                                        warnx("rollback: unable to rename %s back to %s", bup, try);
@@ -175,7 +185,9 @@
                                /* first try to rename it into place */
                                (void) snprintf(try, sizeof(try), "%s/%s", Directory, p->name);
                                if (fexists(try)) {
+#if HAVE_CHFLAGS
                                        (void) chflags(try, 0); /* XXX hack - if truly immutable, rename fails */
+#endif
                                        if (preserve && PkgName) {
                                                char    pf[MaxPathSize];
 
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/add/futil.c
--- a/usr.sbin/pkg_install/add/futil.c  Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/add/futil.c  Sun Nov 06 13:43:17 2005 +0000
@@ -1,11 +1,17 @@
-/*     $NetBSD: futil.c,v 1.14 2003/09/24 06:18:16 agc Exp $   */
+/*     $NetBSD: futil.c,v 1.14.6.1 2005/11/06 13:43:18 tron Exp $      */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp";
 #else
-__RCSID("$NetBSD: futil.c,v 1.14 2003/09/24 06:18:16 agc Exp $");
+__RCSID("$NetBSD: futil.c,v 1.14.6.1 2005/11/06 13:43:18 tron Exp $");
 #endif
 #endif
 
@@ -29,7 +35,9 @@
  *
  */
 
+#if HAVE_ERR_H
 #include <err.h>
+#endif
 #include "lib.h"
 #include "add.h"
 
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/add/main.c
--- a/usr.sbin/pkg_install/add/main.c   Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/add/main.c   Sun Nov 06 13:43:17 2005 +0000
@@ -1,11 +1,17 @@
-/*     $NetBSD: main.c,v 1.34.2.1 2005/11/06 13:40:52 tron Exp $       */
+/*     $NetBSD: main.c,v 1.34.2.2 2005/11/06 13:43:18 tron Exp $       */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 #ifndef lint
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.34.2.1 2005/11/06 13:40:52 tron Exp $");
+__RCSID("$NetBSD: main.c,v 1.34.2.2 2005/11/06 13:43:18 tron Exp $");
 #endif
 #endif
 
@@ -30,9 +36,15 @@
  *
  */
 
+#if HAVE_ERR_H
 #include <err.h>
+#endif
+#if HAVE_SYS_PARAM_H
 #include <sys/param.h>
+#endif
+#if HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
+#endif
 #include "lib.h"
 #include "add.h"
 #include "verify.h"
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Sun Nov 06 13:43:17 2005 +0000
@@ -1,11 +1,17 @@
-/*     $NetBSD: perform.c,v 1.107.2.4 2005/11/06 13:40:52 tron Exp $   */
+/*     $NetBSD: perform.c,v 1.107.2.5 2005/11/06 13:43:18 tron Exp $   */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.107.2.4 2005/11/06 13:40:52 tron Exp $");
+__RCSID("$NetBSD: perform.c,v 1.107.2.5 2005/11/06 13:43:18 tron Exp $");
 #endif
 #endif
 
@@ -29,18 +35,34 @@
  *
  */
 
+#if HAVE_ASSERT_H
 #include <assert.h>
+#endif
+#if HAVE_ERR_H
 #include <err.h>
+#endif
+#if HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include "lib.h"
 #include "add.h"
 #include "verify.h"
 
+#if HAVE_INTTYPES_H
 #include <inttypes.h>
+#endif
+#if HAVE_SIGNAL_H
 #include <signal.h>
+#endif
+#if HAVE_STRING_H
 #include <string.h>
+#endif
+#if HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#if HAVE_SYS_UTSNAME_H
 #include <sys/utsname.h>
+#endif
 
 static char LogDir[MaxPathSize];
 static int zapLogDir;          /* Should we delete LogDir? */
@@ -48,6 +70,26 @@
 static package_t Plist;
 static char *Home;
 
+/*
+ * Some systems such as OpenBSD-3.6 do not provide PRIu64.
+ * Others such as AIX-4.3.2 have a broken PRIu64 which includes
+ * a leading "%".
+ */
+#ifdef NEED_PRI_MACRO
+#  ifdef PRIu64
+#    undef PRIu64
+#  endif
+#  if SIZEOF_INT == 8
+#    define PRIu64 "u"
+#  elif SIZEOF_LONG == 8
+#    define PRIu64 "lu"
+#  elif SIZEOF_LONG_LONG == 8
+#    define PRIu64 "llu"
+#  else
+#    error "unable to find a suitable PRIu64"
+#  endif
+#endif
+
 /* used in build information */
 enum {
        Good,
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/add/verify.c
--- a/usr.sbin/pkg_install/add/verify.c Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/add/verify.c Sun Nov 06 13:43:17 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: verify.c,v 1.6 2004/12/29 11:34:59 agc Exp $ */
+/* $NetBSD: verify.c,v 1.6.2.1 2005/11/06 13:43:18 tron Exp $ */
 
 /*
  * Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -30,22 +30,42 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: verify.c,v 1.6 2004/12/29 11:34:59 agc Exp $");
+__RCSID("$NetBSD: verify.c,v 1.6.2.1 2005/11/06 13:43:18 tron Exp $");
+#endif
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
 #endif
 
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-
+#if HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#if HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#if HAVE_STRING_H
 #include <string.h>
+#endif
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "verify.h"
 #include "lib.h"
diff -r dc4d97d4a9c6 -r 2abd33388334 usr.sbin/pkg_install/admin/main.c
--- a/usr.sbin/pkg_install/admin/main.c Sun Nov 06 13:42:12 2005 +0000
+++ b/usr.sbin/pkg_install/admin/main.c Sun Nov 06 13:43:17 2005 +0000
@@ -1,8 +1,14 @@
-/*     $NetBSD: main.c,v 1.48.2.1 2005/11/06 13:40:51 tron Exp $       */
+/*     $NetBSD: main.c,v 1.48.2.2 2005/11/06 13:43:18 tron Exp $       */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <nbcompat.h>
+#if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
+#endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.48.2.1 2005/11/06 13:40:51 tron Exp $");
+__RCSID("$NetBSD: main.c,v 1.48.2.2 2005/11/06 13:43:18 tron Exp $");



Home | Main Index | Thread Index | Old Index