summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-06-04 11:23:13 +0000
committerjoerg <joerg@pkgsrc.org>2008-06-04 11:23:13 +0000
commitd6bd33a6b126144885bfba6906c8175fca7056e3 (patch)
tree2a3f2bf39fdb9cd958f3b2573af83b79b5565a1e
parent26c9d2bc8d1ec173f9e2df7d5c07ac481a25ada1 (diff)
downloadpkgsrc-d6bd33a6b126144885bfba6906c8175fca7056e3.tar.gz
pkg_install-20080603:
pkg_admin check-signature exits with 0 only if all given packages have a valid signature. pkg_add will keep the preserve state of a package when updating.
-rw-r--r--pkgtools/pkg_install/files/add/perform.c37
-rw-r--r--pkgtools/pkg_install/files/admin/main.c10
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
3 files changed, 35 insertions, 16 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index ada01eb3faf..6ef01487f16 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.70.4.7 2008/05/26 15:29:03 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.70.4.8 2008/06/04 11:23:13 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.70.4.7 2008/05/26 15:29:03 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.70.4.8 2008/06/04 11:23:13 joerg Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -1043,20 +1043,35 @@ pkg_register_views(struct pkg_task *pkg)
static int
start_replacing(struct pkg_task *pkg)
{
- char *old_required_by, *new_required_by;
-
- old_required_by = pkgdb_pkg_file(pkg->other_version,
- REQUIRED_BY_FNAME);
- new_required_by = pkgdb_pkg_file(pkg->pkgname,
- REQUIRED_BY_FNAME);
-
if (!Fake) {
- if (rename(old_required_by, new_required_by) == -1 &&
+ char *old_file, *new_file;
+
+ old_file = pkgdb_pkg_file(pkg->other_version,
+ REQUIRED_BY_FNAME);
+ new_file = pkgdb_pkg_file(pkg->pkgname, REQUIRED_BY_FNAME);
+ if (rename(old_file, new_file) == -1 &&
errno != ENOENT) {
warn("Can't move +REQUIRED_BY from %s to %s",
- old_required_by, new_required_by);
+ old_file, new_file);
+ return -1;
+ }
+ free(old_file);
+ free(new_file);
+ }
+
+ if (!Fake && pkg->meta_data.meta_preserve == NULL) {
+ char *old_file, *new_file;
+
+ old_file = pkgdb_pkg_file(pkg->other_version, PRESERVE_FNAME);
+ new_file = pkgdb_pkg_file(pkg->pkgname, PRESERVE_FNAME);
+ if (rename(old_file, new_file) == -1 &&
+ errno != ENOENT) {
+ warn("Can't move +PRESERVED from %s to %s",
+ old_file, new_file);
return -1;
}
+ free(old_file);
+ free(new_file);
}
if (Verbose || Fake) {
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index d31c15e2f42..515795a7926 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.42.2.4 2008/05/23 15:57:04 joerg Exp $ */
+/* $NetBSD: main.c,v 1.42.2.5 2008/06/04 11:23:13 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.42.2.4 2008/05/23 15:57:04 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.42.2.5 2008/06/04 11:23:13 joerg Exp $");
#endif
/*-
@@ -542,12 +542,16 @@ main(int argc, char *argv[])
#ifdef HAVE_SSL
struct archive *pkg;
void *cookie;
+ int rc;
+ rc = 0;
for (--argc, ++argv; argc > 0; --argc, ++argv) {
pkg = open_archive(*argv, &cookie);
- pkg_full_signature_check(pkg);
+ if (pkg_full_signature_check(pkg))
+ rc = 1;
close_archive(pkg);
}
+ return rc;
#else
errx(EXIT_FAILURE, "OpenSSL support is not included");
#endif
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 07ebbaa557f..21be5de1c26 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.102.2.4 2008/05/26 15:29:03 joerg Exp $ */
+/* $NetBSD: version.h,v 1.102.2.5 2008/06/04 11:23:14 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 "20080526"
+#define PKGTOOLS_VERSION "20080603"
#endif /* _INST_LIB_VERSION_H_ */