summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorjoerg <joerg>2009-10-07 12:53:26 +0000
committerjoerg <joerg>2009-10-07 12:53:26 +0000
commit3c8b2549ecf06ac3c389754f626ba6aae3426978 (patch)
tree62cf204bd505c6083a8fbeaa49464561827967a2 /pkgtools/pkg_install
parentc826d966abb39f72d2b99b612270498d708d505b (diff)
downloadpkgsrc-3c8b2549ecf06ac3c389754f626ba6aae3426978.tar.gz
pkg_install-20091006:
- restore pkg_add -f functionality for missing dependencies (PR 42001) - pkg_admin rebuild should count packages correctly (he@), also count @pkgdb - fix gpg-sign-package syntax in pkg_admin(1) - change default URL for pkg-vulnerabilities to use HTTP
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/add/add.h4
-rw-r--r--pkgtools/pkg_install/files/add/main.c6
-rw-r--r--pkgtools/pkg_install/files/add/perform.c19
-rw-r--r--pkgtools/pkg_install/files/admin/main.c38
-rw-r--r--pkgtools/pkg_install/files/admin/pkg_admin.17
-rw-r--r--pkgtools/pkg_install/files/admin/pkg_admin.cat15
-rw-r--r--pkgtools/pkg_install/files/lib/parse-config.c6
-rw-r--r--pkgtools/pkg_install/files/lib/pkg_install.conf.5.in4
-rw-r--r--pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in2
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
10 files changed, 59 insertions, 36 deletions
diff --git a/pkgtools/pkg_install/files/add/add.h b/pkgtools/pkg_install/files/add/add.h
index 74221f3b38d..d2f073734bb 100644
--- a/pkgtools/pkg_install/files/add/add.h
+++ b/pkgtools/pkg_install/files/add/add.h
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.15 2009/08/16 14:26:46 joerg Exp $ */
+/* $NetBSD: add.h,v 1.16 2009/10/07 12:53:26 joerg Exp $ */
/* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */
@@ -39,6 +39,8 @@ extern Boolean Automatic;
extern int LicenseCheck;
extern int Replace;
+extern Boolean ForceDepends;
+
int make_hierarchy(char *);
void apply_perms(char *, char **, int);
diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c
index 0b7445b4e84..3392bf69135 100644
--- a/pkgtools/pkg_install/files/add/main.c
+++ b/pkgtools/pkg_install/files/add/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.21 2009/09/11 18:00:13 joerg Exp $ */
+/* $NetBSD: main.c,v 1.22 2009/10/07 12:53:26 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.21 2009/09/11 18:00:13 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.22 2009/10/07 12:53:26 joerg Exp $");
/*
*
@@ -51,6 +51,7 @@ Boolean NoView = FALSE;
Boolean NoInstall = FALSE;
Boolean NoRecord = FALSE;
Boolean Automatic = FALSE;
+Boolean ForceDepends = FALSE;
int LicenseCheck = 0;
int Replace = 0;
@@ -89,6 +90,7 @@ main(int argc, char **argv)
case 'f':
Force = TRUE;
+ ForceDepends = TRUE;
break;
case 'I':
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 299ecb0647a..55483e17486 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.90 2009/08/16 14:26:46 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.91 2009/10/07 12:53:26 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.90 2009/08/16 14:26:46 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.91 2009/10/07 12:53:26 joerg Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -1034,12 +1034,19 @@ check_dependencies(struct pkg_task *pkg)
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 --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index 07c687576d8..3541f968c13 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.55 2009/08/16 21:10:14 joerg Exp $ */
+/* $NetBSD: main.c,v 1.56 2009/10/07 12:53:26 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.55 2009/08/16 21:10:14 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.56 2009/10/07 12:53:26 joerg Exp $");
/*-
* Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -82,6 +82,12 @@ __RCSID("$NetBSD: main.c,v 1.55 2009/08/16 21:10:14 joerg Exp $");
#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 @@ add_pkg(const char *pkgdir, void *vp)
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 @@ add_pkg(const char *pkgdir, void *vp)
}
} 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 @@ static void
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 @@ rebuild(void)
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 @@ main(int argc, char *argv[])
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 --git a/pkgtools/pkg_install/files/admin/pkg_admin.1 b/pkgtools/pkg_install/files/admin/pkg_admin.1
index 54ccc4ead16..aa13a4147aa 100644
--- a/pkgtools/pkg_install/files/admin/pkg_admin.1
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_admin.1,v 1.27 2009/08/17 05:06:38 wiz Exp $
+.\" $NetBSD: pkg_admin.1,v 1.28 2009/10/07 12:53:26 joerg Exp $
.\"
.\" Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -289,10 +289,11 @@ to remove a variable.
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 --git a/pkgtools/pkg_install/files/admin/pkg_admin.cat1 b/pkgtools/pkg_install/files/admin/pkg_admin.cat1
index 0508ed986d3..cdfdbee9362 100644
--- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1
@@ -194,8 +194,9 @@ OOPPTTIIOONNSS
Packages that are not installed directly by the user but pulled
in as dependencies are marked by setting ``automatic=YES''.
- ggppgg--ssiiggnn--ppaacckkaaggee ppkkgg
- Sign the binary package _p_k_g using GPG.
+ ggppgg--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg
+ Sign the binary package _p_k_g using GPG and write the result to
+ _s_p_k_g.
xx550099--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg kkeeyy cceerrtt
Sign the binary package _p_k_g using the key _k_e_y and the certificate
diff --git a/pkgtools/pkg_install/files/lib/parse-config.c b/pkgtools/pkg_install/files/lib/parse-config.c
index 22cd0a776eb..341b56093d0 100644
--- a/pkgtools/pkg_install/files/lib/parse-config.c
+++ b/pkgtools/pkg_install/files/lib/parse-config.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse-config.c,v 1.9 2009/08/16 21:10:53 joerg Exp $ */
+/* $NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 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: parse-config.c,v 1.9 2009/08/16 21:10:53 joerg Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 joerg Exp $");
/*-
* Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -70,7 +70,7 @@ const char *pkg_vulnerabilities_dir;
const char *pkg_vulnerabilities_file;
const char *pkg_vulnerabilities_url;
const char *ignore_advisories = NULL;
-const char tnf_vulnerability_base[] = "ftp://ftp.NetBSD.org/pub/NetBSD/packages/vulns";
+const char tnf_vulnerability_base[] = "http://ftp.NetBSD.org/pub/NetBSD/packages/vulns";
const char *acceptable_licenses = NULL;
static struct config_variable {
diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
index 378e0493d5d..dfdd4d0d652 100644
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_install.conf.5.in,v 1.9 2009/08/06 18:16:33 wiz Exp $
+.\" $NetBSD: pkg_install.conf.5.in,v 1.10 2009/10/07 12:53:27 joerg Exp $
.\"
.\" Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -146,7 +146,7 @@ URL which is used for updating the local
file when running
.Dl Ic pkg_admin fetch-pkg-vulnerabilities
The default is
-.Pa ftp://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities.gz
+.Pa http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities.gz
.Em Note :
Usually, only the compression type should be changed.
Currently supported are uncompressed files and files compressed by
diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
index d84343e88fa..91d8e5dde5b 100644
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
@@ -111,7 +111,7 @@ DDEESSCCRRIIPPTTIIOONN
when running
ppkkgg__aaddmmiinn ffeettcchh--ppkkgg--vvuullnneerraabbiilliittiieess
The default is
- _f_t_p_:_/_/_f_t_p_._N_e_t_B_S_D_._o_r_g_/_p_u_b_/_N_e_t_B_S_D_/_p_a_c_k_a_g_e_s_/_v_u_l_n_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s_._g_z
+ _h_t_t_p_:_/_/_f_t_p_._N_e_t_B_S_D_._o_r_g_/_p_u_b_/_N_e_t_B_S_D_/_p_a_c_k_a_g_e_s_/_v_u_l_n_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s_._g_z
_N_o_t_e: Usually, only the compression type should be changed. Cur-
rently supported are uncompressed files and files compressed by
bzip2(1) (_._b_z_2) or gzip(1) (_._g_z).
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index d20b4466e11..b428e1c4e5d 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.137 2009/09/11 18:00:13 joerg Exp $ */
+/* $NetBSD: version.h,v 1.138 2009/10/07 12:53:27 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 "20090911"
+#define PKGTOOLS_VERSION "20091006"
#endif /* _INST_LIB_VERSION_H_ */