summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-13 14:10:30 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-13 14:10:30 +0300
commit279513bfbe8f0f37c6fb7f38dc331f0290b19b2f (patch)
treecd6a5aef78391be52fcfb18d95fe6b1ab5ec3f17 /src/package.c
parentb71606dbf42815cc82b5792eb53438673111a4d5 (diff)
downloadapk-tools-279513bfbe8f0f37c6fb7f38dc331f0290b19b2f.tar.gz
apk-tools-279513bfbe8f0f37c6fb7f38dc331f0290b19b2f.tar.bz2
apk-tools-279513bfbe8f0f37c6fb7f38dc331f0290b19b2f.tar.xz
apk-tools-279513bfbe8f0f37c6fb7f38dc331f0290b19b2f.zip
db: implement triggers (fixes #45)
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/package.c b/src/package.c
index 24faaaf..4445aa6 100644
--- a/src/package.c
+++ b/src/package.c
@@ -66,8 +66,6 @@ struct apk_installed_package *apk_pkg_install(struct apk_database *db,
pkg->ipkg = ipkg = calloc(1, sizeof(struct apk_installed_package));
ipkg->pkg = pkg;
- list_init(&ipkg->installed_pkgs_list);
-
db->installed.stats.packages++;
list_add_tail(&ipkg->installed_pkgs_list, &db->installed.packages);
@@ -869,6 +867,10 @@ int apk_ipkg_run_script(struct apk_installed_package *ipkg, int root_fd,
pkg->name->name, pkg->version,
apk_script_types[type]);
+ apk_message("Executing %s", &fn[15]);
+ if (apk_flags & APK_SIMULATE)
+ return 0;
+
fd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC, 0755);
if (fd < 0) {
mkdirat(root_fd, "var/cache/misc", 0755);
@@ -879,8 +881,6 @@ int apk_ipkg_run_script(struct apk_installed_package *ipkg, int root_fd,
write(fd, ipkg->script[type].ptr, ipkg->script[type].len);
close(fd);
- apk_message("Executing %s", &fn[15]);
-
pid = fork();
if (pid == -1)
return -1;