Source-Changes-HG archive

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

[src/netbsd-1-4]: src/usr.sbin/pkg_install/delete Pull up 1.24-1.25:



details:   https://anonhg.NetBSD.org/src/rev/f2e6f8058d68
branches:  netbsd-1-4
changeset: 469267:f2e6f8058d68
user:      he <he%NetBSD.org@localhost>
date:      Sun Aug 22 17:54:55 1999 +0000

description:
Pull up 1.24-1.25:
  Allow specifying a package name without a version.
  Call deinstall-script again after files are removed with
  POST-DEINSTALL argument.  (hubertf)

diffstat:

 usr.sbin/pkg_install/delete/perform.c |  31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r e7fa635369b4 -r f2e6f8058d68 usr.sbin/pkg_install/delete/perform.c
--- a/usr.sbin/pkg_install/delete/perform.c     Sun Aug 22 17:50:20 1999 +0000
+++ b/usr.sbin/pkg_install/delete/perform.c     Sun Aug 22 17:54:55 1999 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.23 1999/03/22 06:04:16 abs Exp $ */
+/*     $NetBSD: perform.c,v 1.23.2.1 1999/08/22 17:54:55 he Exp $      */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #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 1999/03/22 06:04:16 abs Exp $");
+__RCSID("$NetBSD: perform.c,v 1.23.2.1 1999/08/22 17:54:55 he Exp $");
 #endif
 #endif
 
@@ -475,6 +475,21 @@
     (void) snprintf(LogDir, sizeof(LogDir), "%s/%s", (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR,
            pkg);
     if (!fexists(LogDir) || !isdir(LogDir)) {
+       {
+           /* Check if the given package name matches something
+            * with 'pkg-[0-9]*'
+            */
+           char try[FILENAME_MAX];
+           snprintf(try, FILENAME_MAX, "%s-[0-9]*", pkg);
+           if (findmatchingname(_pkgdb_getPKGDB_DIR(), try,
+                                find_fn, NULL) != 0) {
+               return 0; /* we've just appended some names to the pkgs list,
+                          * they will be processed after this package.
+                          */
+           }
+       }
+       
+       /* No match */
        warnx("no such package '%s' installed", pkg);
        return 1;
     }
@@ -582,6 +597,18 @@
        
        require_delete(home, 1);
     }
+    if (!NoDeInstall && fexists(DEINSTALL_FNAME)) {
+       if (Fake)
+           printf("Would execute post-de-install script at this point.\n");
+       else {
+           vsystem("chmod +x %s", DEINSTALL_FNAME);    /* make sure */
+           if (vsystem("./%s %s POST-DEINSTALL", DEINSTALL_FNAME, pkg)) {
+               warnx("post-deinstall script returned error status");
+               if (!Force)
+                   return 1;
+           }
+       }
+    }
     return 0;
 }
 



Home | Main Index | Thread Index | Old Index