Commit e20ce5a9 authored by Timo Teräs's avatar Timo Teräs
Browse files

db: fix script arguments

the first item is place holder for argv[0] = script name. it's
overwritten by the apk_pkgi_run_script.
parent 6c96730c
......@@ -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? */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment