Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/pkg_install/dist pkg_install-20091006:
details: https://anonhg.NetBSD.org/src/rev/b64922aee59d
branches: trunk
changeset: 747973:b64922aee59d
user: joerg <joerg%NetBSD.org@localhost>
date: Wed Oct 07 13:19:36 2009 +0000
description:
pkg_install-20091006:
- restore pkg_add -f functionality for missing dependencies (PR 42001)
- pkg_admin rebuild should count packages correctly (he@), also count @pkgdir
- fix gpg-sign-package syntax in pkg_admin(1)
- change default URL for pkg-vulnerabilities to use HTTP
diffstat:
external/bsd/pkg_install/dist/add/add.h | 4 +-
external/bsd/pkg_install/dist/add/main.c | 9 +-
external/bsd/pkg_install/dist/add/perform.c | 19 ++++--
external/bsd/pkg_install/dist/admin/main.c | 38 ++++++++----
external/bsd/pkg_install/dist/admin/pkg_admin.1 | 7 +-
external/bsd/pkg_install/dist/info/info.h | 3 +-
external/bsd/pkg_install/dist/info/main.c | 19 +------
external/bsd/pkg_install/dist/lib/config.h.in | 48 +---------------
external/bsd/pkg_install/dist/lib/file.c | 7 +-
external/bsd/pkg_install/dist/lib/parse-config.c | 6 +-
external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in | 4 +-
external/bsd/pkg_install/dist/lib/pkgdb.c | 10 +--
external/bsd/pkg_install/dist/lib/version.h | 4 +-
13 files changed, 66 insertions(+), 112 deletions(-)
diffs (truncated from 529 to 300 lines):
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/add/add.h
--- a/external/bsd/pkg_install/dist/add/add.h Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/add/add.h Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.1.1.4 2009/08/21 15:18:57 joerg Exp $ */
+/* $NetBSD: add.h,v 1.1.1.5 2009/10/07 13:19:36 joerg Exp $ */
/* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */
@@ -39,6 +39,8 @@
extern int LicenseCheck;
extern int Replace;
+extern Boolean ForceDepends;
+
int make_hierarchy(char *);
void apply_perms(char *, char **, int);
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/add/main.c
--- a/external/bsd/pkg_install/dist/add/main.c Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/add/main.c Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.1.1.5 2009/08/21 15:18:58 joerg Exp $ */
+/* $NetBSD: main.c,v 1.1.1.6 2009/10/07 13:19:36 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.1.1.5 2009/08/21 15:18:58 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.6 2009/10/07 13:19:36 joerg Exp $");
/*
*
@@ -36,9 +36,6 @@
#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"
@@ -54,6 +51,7 @@
Boolean NoInstall = FALSE;
Boolean NoRecord = FALSE;
Boolean Automatic = FALSE;
+Boolean ForceDepends = FALSE;
int LicenseCheck = 0;
int Replace = 0;
@@ -92,6 +90,7 @@
case 'f':
Force = TRUE;
+ ForceDepends = TRUE;
break;
case 'I':
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/add/perform.c
--- a/external/bsd/pkg_install/dist/add/perform.c Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/add/perform.c Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.1.1.11 2009/08/21 15:19:00 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.1.1.12 2009/10/07 13:19:39 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.1.1.11 2009/08/21 15:19:00 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.1.1.12 2009/10/07 13:19:39 joerg Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1034,12 +1034,19 @@
continue;
}
if (pkg_do(p->name, 1, 0)) {
- warnx("Can't install dependency %s", p->name);
- status = -1;
- break;
+ if (ForceDepends) {
+ warnx("Can't install dependency %s, "
+ "continuing", p->name);
+ continue;
+ } else {
+ warnx("Can't install dependency %s",
+ p->name);
+ status = -1;
+ break;
+ }
}
best_installed = find_best_matching_installed_pkg(p->name);
- if (best_installed == NULL && Force) {
+ if (best_installed == NULL && ForceDepends) {
warnx("Missing dependency %s ignored", p->name);
continue;
} else if (best_installed == NULL) {
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/admin/main.c
--- a/external/bsd/pkg_install/dist/admin/main.c Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/admin/main.c Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.1.1.9 2009/08/21 15:19:05 joerg Exp $ */
+/* $NetBSD: main.c,v 1.1.1.10 2009/10/07 13:19:40 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.1.1.9 2009/08/21 15:19:05 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.10 2009/10/07 13:19:40 joerg Exp $");
/*-
* Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -82,6 +82,12 @@
#define DEFAULT_SFX ".t[bg]z" /* default suffix for ls{all,best} */
+struct pkgdb_count {
+ size_t files;
+ size_t directories;
+ size_t packages;
+};
+
static const char Options[] = "C:K:SVbd:qs:v";
int quiet, verbose;
@@ -138,12 +144,13 @@
char *PkgName, *dirp;
char file[MaxPathSize];
char dir[MaxPathSize];
- int tmp, *cnt;
+ struct pkgdb_count *count;
if (!pkgdb_open(ReadWrite))
err(EXIT_FAILURE, "cannot open pkgdb");
- cnt = vp != NULL ? vp : &tmp;
+ count = vp;
+ ++count->packages;
PkgDBDir = _pkgdb_getPKGDB_DIR();
contents = pkgdb_pkg_file(pkgdir, CONTENTS_FNAME);
@@ -175,12 +182,12 @@
}
} else {
pkgdb_store(file, PkgName);
- (*cnt)++;
+ ++count->files;
}
break;
case PLIST_PKGDIR:
add_pkgdir(PkgName, dirp, p->name);
- (*cnt)++;
+ ++count->directories;
break;
case PLIST_CWD:
if (strcmp(p->name, ".") != 0) {
@@ -231,10 +238,11 @@
rebuild(void)
{
char cachename[MaxPathSize];
- int pkgcnt, filecnt;
+ struct pkgdb_count count;
- pkgcnt = 0;
- filecnt = 0;
+ count.files = 0;
+ count.directories = 0;
+ count.packages = 0;
(void) _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename));
if (unlink(cachename) != 0 && errno != ENOENT)
@@ -242,12 +250,14 @@
setbuf(stdout, NULL);
- iterate_pkg_db(add_pkg, &filecnt);
+ iterate_pkg_db(add_pkg, &count);
printf("\n");
- printf("Stored %d file%s from %d package%s in %s.\n",
- filecnt, filecnt == 1 ? "" : "s",
- pkgcnt, pkgcnt == 1 ? "" : "s",
+ printf("Stored %zu file%s and %zu explizit director%s"
+ " from %zu package%s in %s.\n",
+ count.files, count.files == 1 ? "" : "s",
+ count.directories, count.directories == 1 ? "y" : "ies",
+ count.packages, count.packages == 1 ? "" : "s",
cachename);
}
@@ -415,7 +425,7 @@
pkg_install_config();
if (use_default_sfx)
- (void) snprintf(sfx, sizeof(sfx), "%s", DEFAULT_SFX);
+ (void) strlcpy(sfx, DEFAULT_SFX, sizeof(sfx));
if (strcasecmp(argv[0], "pmatch") == 0) {
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/admin/pkg_admin.1
--- a/external/bsd/pkg_install/dist/admin/pkg_admin.1 Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/admin/pkg_admin.1 Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_admin.1,v 1.1.1.8 2009/08/21 15:19:05 joerg Exp $
+.\" $NetBSD: pkg_admin.1,v 1.1.1.9 2009/10/07 13:19:40 joerg Exp $
.\"
.\" Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -289,10 +289,11 @@
Packages that are not installed directly by the user but pulled in as
dependencies are marked by setting
.Dq automatic=YES .
-.It Cm gpg-sign-package pkg
+.It Cm gpg-sign-package pkg spkg
Sign the binary package
.Ar pkg
-using GPG.
+using GPG and write the result to
+.Ar spkg .
.It Cm x509-sign-package pkg spkg key cert
Sign the binary package
.Ar pkg
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/info/info.h
--- a/external/bsd/pkg_install/dist/info/info.h Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/info/info.h Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: info.h,v 1.1.1.4 2009/08/06 16:55:25 joerg Exp $ */
+/* $NetBSD: info.h,v 1.1.1.5 2009/10/07 13:19:42 joerg Exp $ */
/* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */
@@ -114,7 +114,6 @@
extern Boolean Quiet;
extern const char *InfoPrefix;
extern const char *BuildInfoVariable;
-extern size_t termwidth;
extern lpkg_head_t pkgs;
int CheckForPkg(const char *);
diff -r b728bdc77c64 -r b64922aee59d external/bsd/pkg_install/dist/info/main.c
--- a/external/bsd/pkg_install/dist/info/main.c Wed Oct 07 10:23:50 2009 +0000
+++ b/external/bsd/pkg_install/dist/info/main.c Wed Oct 07 13:19:36 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.1.1.6 2009/08/06 16:55:25 joerg Exp $ */
+/* $NetBSD: main.c,v 1.1.1.7 2009/10/07 13:19:42 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.1.1.6 2009/08/06 16:55:25 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.7 2009/10/07 13:19:42 joerg Exp $");
/*
*
@@ -34,9 +34,6 @@
#include <sys/ioctl.h>
#endif
-#if HAVE_TERMIOS_H
-#include <termios.h>
-#endif
#if HAVE_ERR_H
#include <err.h>
#endif
@@ -52,7 +49,6 @@
Boolean Quiet = FALSE;
const char *InfoPrefix = "";
const char *BuildInfoVariable = "";
-size_t termwidth = 0;
lpkg_head_t pkgs;
static void
@@ -324,17 +320,6 @@
if (TAILQ_FIRST(&pkgs) == NULL && Which == WHICH_LIST && !CheckPkg)
warnx("missing package name(s)"), usage();
- if (isatty(STDOUT_FILENO)) {
- const char *p;
- struct winsize win;
-
- if ((p = getenv("COLUMNS")) != NULL)
- termwidth = atoi(p);
- else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
- win.ws_col > 0)
- termwidth = win.ws_col;
- }
-
Home |
Main Index |
Thread Index |
Old Index