From 98adbf34a1a51a15844993dbe7b8b29e8ef418c3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 7 Mar 2013 11:56:08 +0100 Subject: [PATCH] xbps_pkg_exec_buffer: pass correct args to the install/remove scripts. --- lib/package_script.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/package_script.c b/lib/package_script.c index 97ead0b3..66c7d839 100644 --- a/lib/package_script.c +++ b/lib/package_script.c @@ -40,8 +40,8 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp, bool update) { ssize_t ret; - const char *tmpdir; - char *fpath; + const char *tmpdir, *version; + char *pkgname, *fpath; int fd, rv; assert(blob); @@ -85,9 +85,15 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp, close(fd); /* exec script */ - rv = xbps_file_exec(xhp, fpath, action, pkgver, + pkgname = xbps_pkg_name(pkgver); + assert(pkgname); + version = xbps_pkg_version(pkgver); + assert(version); + + rv = xbps_file_exec(xhp, fpath, action, pkgname, version, update ? "yes" : "no", xhp->conffile, NULL); + free(pkgname); out: remove(fpath);