summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2008-11-07 13:22:16 +0200
committerTimo Teras <timo.teras@iki.fi>2008-11-07 13:22:16 +0200
commit6967c28b96784d474e6c2f50b075895d89f9ce02 (patch)
treeed9aeb922dce223abacd41f51a1af8a3c7399789 /src
parent36f73847ee4faa9fd84d2bd5be3f28ff70c7bf19 (diff)
downloadapk-tools-6967c28b96784d474e6c2f50b075895d89f9ce02.tar.gz
apk-tools-6967c28b96784d474e6c2f50b075895d89f9ce02.tar.bz2
apk-tools-6967c28b96784d474e6c2f50b075895d89f9ce02.tar.xz
apk-tools-6967c28b96784d474e6c2f50b075895d89f9ce02.zip
db: fix installation of apk v1 packages
Diffstat (limited to 'src')
-rw-r--r--src/database.c4
-rw-r--r--src/package.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c
index 6b32255..a2caa53 100644
--- a/src/database.c
+++ b/src/database.c
@@ -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);
diff --git a/src/package.c b/src/package.c
index 1cbf203..1b41444 100644
--- a/src/package.c
+++ b/src/package.c
@@ -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 {