Commit 6967c28b authored by Timo Teräs's avatar Timo Teräs

db: fix installation of apk v1 packages

parent 36f73847
......@@ -692,7 +692,7 @@ static int apk_db_install_archive_entry(struct apk_archive_entry *ae,
p += strlen(pkg->version) + 1;
type = apk_script_type(p);
if (type != APK_SCRIPT_INVALID)
if (type == APK_SCRIPT_INVALID)
return 0;
}
......@@ -703,7 +703,7 @@ static int apk_db_install_archive_entry(struct apk_archive_entry *ae,
if (type == APK_SCRIPT_GENERIC ||
type == ctx->script) {
r = apk_pkg_run_script(pkg, db->root_fd, type);
r = apk_pkg_run_script(pkg, db->root_fd, ctx->script);
if (r != 0)
apk_error("%s-%s: Failed to execute pre-install/upgrade script",
pkg->name->name, pkg->version);
......
......@@ -172,7 +172,7 @@ int apk_script_type(const char *name)
strcmp(script_types[i], name) == 0)
return i;
return -1;
return APK_SCRIPT_INVALID;
}
struct read_info_ctx {
......
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