1) don't remove pre/post scripts if isdebug is set
authorewt <devnull@localhost>
Wed, 12 Feb 1997 05:05:58 +0000 (05:05 +0000)
committerewt <devnull@localhost>
Wed, 12 Feb 1997 05:05:58 +0000 (05:05 +0000)
2) use '-xs' reather then separate args -- works around some broken shells

CVS patchset: 1407
CVS date: 1997/02/12 05:05:58

lib/uninstall.c

index 0c2967d..9447384 100644 (file)
@@ -334,7 +334,7 @@ int runScript(char * prefix, Header h, int tag, int arg, int norunScripts) {
        fn = tmpnam(NULL);
        rpmMessage(RPMMESS_DEBUG, "script found - running from file %s\n", fn);
        fd = open(fn, O_CREAT | O_RDWR);
-       unlink(fn);
+       if (!isdebug) unlink(fn);
        if (fd < 0) {
            rpmError(RPMERR_SCRIPT, "error creating file for (un)install script");
            return 1;
@@ -361,7 +361,7 @@ int runScript(char * prefix, Header h, int tag, int arg, int norunScripts) {
            }
 
            if (isdebug)
-               execl("/bin/sh", "/bin/sh", "-x", "-s", upgradeArg, NULL);
+               execl("/bin/sh", "/bin/sh", "-xs", upgradeArg, NULL);
            else
                execl("/bin/sh", "/bin/sh", "-s", upgradeArg, NULL);
            _exit(-1);