summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg>2008-08-05 18:31:06 +0000
committerjoerg <joerg>2008-08-05 18:31:06 +0000
commit9e1e1d7a59926e730d677a4b108edf14143afc5c (patch)
tree54a834c0c7c5f76b096df3e396b88a6165a6683b
parente0f1cf1ac10f53af80dc4870b684465ad20f4677 (diff)
downloadpkgsrc-9e1e1d7a59926e730d677a4b108edf14143afc5c.tar.gz
The iteration functions can deal with full package names, so remove the
fexists case and the associated chdir logic.
-rw-r--r--pkgtools/pkg_install/files/delete/perform.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/pkgtools/pkg_install/files/delete/perform.c b/pkgtools/pkg_install/files/delete/perform.c
index 0f6a6f19ea4..35ffde016f6 100644
--- a/pkgtools/pkg_install/files/delete/perform.c
+++ b/pkgtools/pkg_install/files/delete/perform.c
@@ -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 @@ require_delete(char *home, int tryall)
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)