index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-11-18 16:49:02 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-18 16:49:02 -0600 |
commit | 23b4e0270b1a1881b2daf362a398a3bdc20fab43 (patch) | |
tree | 35a543992891c1e4ed1e19a25f1debb0dfb96797 /lib/libalpm | |
parent | 2aa7e69da91c1d7a18473cf05df98c92bd1dc747 (diff) |
-rw-r--r-- | lib/libalpm/trans.c | 15 |
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 50e346d9..b7085ba1 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -505,14 +505,21 @@ int _alpm_runscriptlet(const char *root, const char *installfn, /* either extract or copy the scriptlet */ snprintf(scriptfn, PATH_MAX, "%s/.INSTALL", tmpdir); if(!strcmp(script, "pre_upgrade") || !strcmp(script, "pre_install")) { - _alpm_unpack(installfn, tmpdir, ".INSTALL"); + if(_alpm_unpack(installfn, tmpdir, ".INSTALL")) { + retval = 1; + } } else { if(_alpm_copyfile(installfn, scriptfn)) { _alpm_log(PM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), scriptfn, strerror(errno)); retval = 1; - goto cleanup; } } + if(retval == 1) { + goto cleanup; + } + + /* mark the scriptlet as executable */ + chmod(scriptfn, 0755); /* chop off the root so we can find the tmpdir in the chroot */ scriptpath = scriptfn + strlen(root) - 1; @@ -538,10 +545,10 @@ int _alpm_runscriptlet(const char *root, const char *installfn, _alpm_log(PM_LOG_DEBUG, "executing %s script...\n", script); if(oldver) { - snprintf(cmdline, PATH_MAX, ". %s %s %s %s", + snprintf(cmdline, PATH_MAX, "%s %s %s %s", scriptpath, script, ver, oldver); } else { - snprintf(cmdline, PATH_MAX, ". %s %s %s", + snprintf(cmdline, PATH_MAX, "%s %s %s", scriptpath, script, ver); } _alpm_log(PM_LOG_DEBUG, "%s\n", cmdline); |