pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/delete If the plist doesn't...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2aa6d7df599
branches:  trunk
changeset: 391991:c2aa6d7df599
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Apr 23 22:13:00 2009 +0000

description:
If the plist doesn't have a @name tag in it, fake one up based on the
directory name.

diffstat:

 pkgtools/pkg_install/files/delete/pkg_delete.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r ae37ecc677b7 -r c2aa6d7df599 pkgtools/pkg_install/files/delete/pkg_delete.c
--- a/pkgtools/pkg_install/files/delete/pkg_delete.c    Thu Apr 23 21:38:16 2009 +0000
+++ b/pkgtools/pkg_install/files/delete/pkg_delete.c    Thu Apr 23 22:13:00 2009 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index