summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c
index d685415..df6e7f0 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1230,6 +1230,10 @@ static int fire_triggers(apk_hash_item item, void *ctx)
FNM_PATHNAME) != 0)
continue;
+ if (ipkg->pending_triggers == NULL)
+ *apk_string_array_add(&ipkg->pending_triggers) =
+ NULL;
+
*apk_string_array_add(&ipkg->pending_triggers) =
dbd->rooted_name;
break;
@@ -2000,16 +2004,16 @@ int apk_db_install_pkg(struct apk_database *db,
struct apk_package *newpkg,
apk_progress_cb cb, void *cb_ctx)
{
- char *script_args[] = { NULL, NULL, NULL };
+ char *script_args[] = { NULL, NULL, NULL, NULL };
struct apk_installed_package *ipkg;
int r;
/* Upgrade script gets two args: <new-pkg> <old-pkg> */
if (oldpkg != NULL && newpkg != NULL) {
- script_args[0] = newpkg->version;
- script_args[1] = oldpkg->version;
+ script_args[1] = newpkg->version;
+ script_args[2] = oldpkg->version;
} else {
- script_args[0] = oldpkg ? oldpkg->version : newpkg->version;
+ script_args[1] = oldpkg ? oldpkg->version : newpkg->version;
}
/* Just purging? */