diff options
author | joerg <joerg> | 2009-04-23 22:13:00 +0000 |
---|---|---|
committer | joerg <joerg> | 2009-04-23 22:13:00 +0000 |
commit | b10758e07d9a2cc69341e3fba259bfc594bdf166 (patch) | |
tree | c2b3e9408364ad733efcdd19252313ae3f77e2c3 /pkgtools/pkg_install | |
parent | 62b3395170326e585a119a6f9a891f917de416c7 (diff) | |
download | pkgsrc-b10758e07d9a2cc69341e3fba259bfc594bdf166.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/pkg_install')
-rw-r--r-- | pkgtools/pkg_install/files/delete/pkg_delete.c | 8 |
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); |