pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install/files pkg_instal...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6f488b3c2f29
branches: pkg_install-renovation
changeset: 541555:6f488b3c2f29
user: joerg <joerg%pkgsrc.org@localhost>
date: Wed Jun 04 11:23:13 2008 +0000
description:
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.
diffstat:
pkgtools/pkg_install/files/add/perform.c | 37 ++++++++++++++++++++++---------
pkgtools/pkg_install/files/admin/main.c | 10 ++++++--
pkgtools/pkg_install/files/lib/version.h | 4 +-
3 files changed, 35 insertions(+), 16 deletions(-)
diffs (116 lines):
diff -r e1c1a346ba85 -r 6f488b3c2f29 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c Fri May 30 13:49:07 2008 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c Wed Jun 04 11:23:13 2008 +0000
@@ -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@localhost>
@@ -1043,20 +1043,35 @@
static int
start_replacing(struct pkg_task *pkg)
{
- char *old_required_by, *new_required_by;
+ if (!Fake) {
+ char *old_file, *new_file;
- 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 &&
+ 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 -r e1c1a346ba85 -r 6f488b3c2f29 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c Fri May 30 13:49:07 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c Wed Jun 04 11:23:13 2008 +0000
@@ -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 @@
#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 -r e1c1a346ba85 -r 6f488b3c2f29 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h Fri May 30 13:49:07 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h Wed Jun 04 11:23:13 2008 +0000
@@ -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_ */
Home |
Main Index |
Thread Index |
Old Index