summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2009-04-23 22:13:00 +0000
committerjoerg <joerg@pkgsrc.org>2009-04-23 22:13:00 +0000
commit805721649ef8066abb289a1fb982f6ab00dbffb6 (patch)
treec2b3e9408364ad733efcdd19252313ae3f77e2c3 /pkgtools
parent2b4f3d904fe5642cf368ef6469be487c1e72312d (diff)
downloadpkgsrc-805721649ef8066abb289a1fb982f6ab00dbffb6.tar.gz
If the plist doesn't have a @name tag in it, fake one up based on the
directory name.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/delete/pkg_delete.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.c b/pkgtools/pkg_install/files/delete/pkg_delete.c
index 923b03dad77..803b0269315 100644
--- a/pkgtools/pkg_install/files/delete/pkg_delete.c
+++ b/pkgtools/pkg_install/files/delete/pkg_delete.c
@@ -34,7 +34,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: pkg_delete.c,v 1.4 2009/03/30 19:26:39 joerg Exp $");
+__RCSID("$NetBSD: pkg_delete.c,v 1.5 2009/04/23 22:13:00 joerg Exp $");
#if HAVE_ERR_H
#include <err.h>
@@ -671,6 +671,12 @@ remove_pkg(const char *pkg)
return 1;
}
+ if (find_plist(&plist, PLIST_NAME) == NULL) {
+ /* Cheat a bit to allow removal of such bad packages. */
+ warnx("Package `%s' doesn't have a name", pkg);
+ add_plist_top(&plist, PLIST_NAME, pkg);
+ }
+
setenv(PKG_PREFIX_VNAME, p->name, 1);
fname = xasprintf("%s/%s", _pkgdb_getPKGDB_DIR(), pkg);
setenv(PKG_METADATA_DIR_VNAME, fname, 1);