summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-09-29 13:19:43 +0000
committerjkh <jkh@FreeBSD.org>1994-09-29 13:19:43 +0000
commit3ef0581e73d5178f71ceb3fa2ec31b843c8d49b8 (patch)
tree0a54543e352f476b57ae299bf0e92040f9dc3a94 /usr.sbin/pkg_install/lib
parente9bb220eefc37eecee5de118173282f633485000 (diff)
downloadFreeBSD-src-3ef0581e73d5178f71ceb3fa2ec31b843c8d49b8.zip
FreeBSD-src-3ef0581e73d5178f71ceb3fa2ec31b843c8d49b8.tar.gz
Don't let pkg_delete remove the recorded location until everything has
absolutely, positively been successfully removed. Reviewed by: Submitted by: Obtained from:
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/lib.h4
-rw-r--r--usr.sbin/pkg_install/lib/plist.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h
index 4f34569..08de0be 100644
--- a/usr.sbin/pkg_install/lib/lib.h
+++ b/usr.sbin/pkg_install/lib/lib.h
@@ -1,4 +1,4 @@
-/* $Id: lib.h,v 1.7 1994/05/25 18:00:04 asami Exp $ */
+/* $Id: lib.h,v 1.8 1994/08/28 14:15:29 jkh Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -141,7 +141,7 @@ void add_plist_top(Package *, plist_t, char *);
void write_plist(Package *, FILE *);
void read_plist(Package *, FILE *);
int plist_cmd(char *, char **);
-void delete_package(Boolean, Package *);
+int delete_package(Boolean, Package *);
/* For all */
void usage(const char *, const char *, ...);
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c
index d2708fd..577ae5e 100644
--- a/usr.sbin/pkg_install/lib/plist.c
+++ b/usr.sbin/pkg_install/lib/plist.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: plist.c,v 1.7 1994/07/11 01:11:14 jkh Exp $";
+static const char *rcsid = "$Id: plist.c,v 1.8 1994/08/28 14:15:30 jkh Exp $";
#endif
/*
@@ -296,11 +296,12 @@ write_plist(Package *pkg, FILE *fp)
}
/* Delete the results of a package installation, not the packaging itself */
-void
+int
delete_package(Boolean ign_err, Package *pkg)
{
PackingList p = pkg->head;
char *Where = ".", *last_file = "";
+ Boolean fail = SUCCESS;
while (p) {
if (p->type == PLIST_CWD) {
@@ -314,8 +315,10 @@ delete_package(Boolean ign_err, Package *pkg)
format_cmd(cmd, p->name, Where, last_file);
if (Verbose)
printf("unexec command: %s\n", cmd);
- if (!Fake && system(cmd))
+ if (!Fake && system(cmd)) {
whinge("unexec '%s' failed.", cmd);
+ fail = FAIL;
+ }
}
else if (p->type == PLIST_IGNORE)
p = p->next;
@@ -326,12 +329,15 @@ delete_package(Boolean ign_err, Package *pkg)
if (Verbose)
printf("Delete: %s\n", full_name);
- if (!Fake && delete_hierarchy(full_name, ign_err))
+ if (!Fake && delete_hierarchy(full_name, ign_err)) {
whinge("Unable to completely remove file '%s'", full_name);
+ fail = FAIL;
+ }
last_file = p->name;
}
p = p->next;
}
+ return fail;
}
/* Selectively delete a hierarchy */
OpenPOWER on IntegriCloud