Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 33b85c0b..653d2bd9 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -650,14 +650,12 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* run the post-install script if it exists */
if(alpm_pkg_has_scriptlet(newpkg)
&& !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
- char scriptlet[PATH_MAX];
- const char *scriptlet_name;
- snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
- _alpm_db_path(db), newpkg->name, newpkg->version);
- scriptlet_name = is_upgrade ? "post_upgrade" : "post_install";
+ char *scriptlet = _alpm_local_db_pkgpath(db, newpkg, "install");
+ const char *scriptlet_name = is_upgrade ? "post_upgrade" : "post_install";
_alpm_runscriptlet(handle, scriptlet, scriptlet_name,
newpkg->version, oldpkg ? oldpkg->version : NULL, 0);
+ free(scriptlet);
}
if(is_upgrade) {