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/delete The...
details: https://anonhg.NetBSD.org/pkgsrc/rev/5820a4f67512
branches: pkg_install-renovation
changeset: 541578:5820a4f67512
user: joerg <joerg%pkgsrc.org@localhost>
date: Tue Aug 05 18:31:06 2008 +0000
description:
The iteration functions can deal with full package names, so remove the
fexists case and the associated chdir logic.
diffstat:
pkgtools/pkg_install/files/delete/perform.c | 37 +++++-----------------------
1 files changed, 7 insertions(+), 30 deletions(-)
diffs (62 lines):
diff -r de0348467ccb -r 5820a4f67512 pkgtools/pkg_install/files/delete/perform.c
--- a/pkgtools/pkg_install/files/delete/perform.c Tue Aug 05 18:09:01 2008 +0000
+++ b/pkgtools/pkg_install/files/delete/perform.c Tue Aug 05 18:31:06 2008 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.23.2.1 2008/07/30 15:38:37 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.23.2.2 2008/08/05 18:31:06 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.23.2.1 2008/07/30 15:38:37 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.23.2.2 2008/08/05 18:31:06 joerg Exp $");
#endif
#endif
@@ -287,38 +287,15 @@
free(best_installed);
best_installed = NULL;
- /* go to the db dir */
- if (chdir(pkgdir) == FAIL) {
- warnx("unable to change directory to %s, deinstall failed (1)",
- pkgdir);
- fail = 1;
- break;
- }
-
/* look to see if package was already deleted */
- if (ispkgpattern(lpp->lp_name)) {
-
- best_installed = find_best_matching_installed_pkg(lpp->lp_name);
- if (best_installed == NULL) {
- warnx("%s appears to have been deleted", lpp->lp_name);
- continue;
- }
- } else {
- if (!fexists(lpp->lp_name)) {
- warnx("%s appears to have been deleted", lpp->lp_name);
- continue;
- }
- }
-
- /* return home for execution of command */
- if (chdir(home) == FAIL) {
- warnx("unable to change directory to %s, deinstall failed (2)", home);
- fail = 1;
- break;
+ best_installed = find_best_matching_installed_pkg(lpp->lp_name);
+ if (best_installed == NULL) {
+ warnx("%s appears to have been deleted", lpp->lp_name);
+ continue;
}
if (Verbose)
- printf("deinstalling %s\n", best_installed ? best_installed : lpp->lp_name);
+ printf("deinstalling %s\n", best_installed);
/* delete the package */
if (Fake)
Home |
Main Index |
Thread Index |
Old Index