summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-10-31 21:07:30 +0000
committerewt <devnull@localhost>1996-10-31 21:07:30 +0000
commit95fc0bdd1dab527d8cd90d63bf8d2980ea16ccf4 (patch)
tree333a2f08af7810ff8590a1b0c90f41d33e34ca5b
parentdaae77f092a2bd4a21374ccd7e5a7cabd603b304 (diff)
downloadrpm-95fc0bdd1dab527d8cd90d63bf8d2980ea16ccf4.tar.gz
rpm-95fc0bdd1dab527d8cd90d63bf8d2980ea16ccf4.tar.bz2
rpm-95fc0bdd1dab527d8cd90d63bf8d2980ea16ccf4.zip
1) don't remove package when preinstall script fails
2) removed extraneous \n from error() calls CVS patchset: 1142 CVS date: 1996/10/31 21:07:30
-rw-r--r--lib/uninstall.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/uninstall.c b/lib/uninstall.c
index 4507ef77f..6eeb881f7 100644
--- a/lib/uninstall.c
+++ b/lib/uninstall.c
@@ -140,7 +140,7 @@ static int handleSharedFiles(rpmdb db, int offset, char ** fileList,
if (!getEntry(sech, RPMTAG_FILENAMES, &type,
(void **) &secFileList, &secFileCount)) {
- error(RPMERR_DBCORRUPT, "package %s contains no files\n",
+ error(RPMERR_DBCORRUPT, "package %s contains no files",
name);
freeHeader(sech);
rc = 1;
@@ -235,7 +235,12 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
}
message(MESS_DEBUG, "running preuninstall script (if any)\n");
- runScript(prefix, h, RPMTAG_PREUN, scriptArg, flags & UNINSTALL_NOSCRIPTS);
+
+ if (runScript(prefix, h, RPMTAG_PREUN, scriptArg,
+ flags & UNINSTALL_NOSCRIPTS)) {
+ freeHeader(h);
+ return 1;
+ }
message(MESS_DEBUG, "%s files test = %d\n", rmmess, flags & UNINSTALL_TEST);
if (getEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList,
@@ -364,7 +369,7 @@ int runScript(char * prefix, Header h, int tag, int arg, int norunScripts) {
waitpid(child, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
- error(RPMERR_SCRIPT, "execution of script failed\n");
+ error(RPMERR_SCRIPT, "execution of script failed");
return 1;
}
}