diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-10 17:57:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-10 18:01:10 +0000 |
commit | c4ce2142d755830469968be0420cbb7465f6aba2 (patch) | |
tree | 81c598564eeb53143289cf7bb9dee880a013e096 | |
parent | 7b7994550926f88bb4ffdde9fe7bf350ad4c6d62 (diff) | |
download | alpine_aports-c4ce2142d755830469968be0420cbb7465f6aba2.tar.bz2 alpine_aports-c4ce2142d755830469968be0420cbb7465f6aba2.tar.xz alpine_aports-c4ce2142d755830469968be0420cbb7465f6aba2.zip |
main/apk-tools: fix triggers
(cherry picked from commit 69d1a01ed750e087d362c43d717ebcec55289357)
-rw-r--r-- | main/apk-tools/APKBUILD | 6 | ||||
-rw-r--r-- | main/apk-tools/triggers.patch | 42 |
2 files changed, 46 insertions, 2 deletions
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index c8672ac979..0fafb00356 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD | |||
@@ -1,12 +1,13 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=apk-tools | 2 | pkgname=apk-tools |
3 | pkgver=2.0.3 | 3 | pkgver=2.0.3 |
4 | pkgrel=0 | 4 | pkgrel=1 |
5 | pkgdesc="Alpine Package Keeper - package manager for alpine" | 5 | pkgdesc="Alpine Package Keeper - package manager for alpine" |
6 | subpackages="$pkgname-static" | 6 | subpackages="$pkgname-static" |
7 | depends= | 7 | depends= |
8 | makedepends="zlib-dev openssl-dev pkgconfig" | 8 | makedepends="zlib-dev openssl-dev pkgconfig" |
9 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 | 9 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 |
10 | triggers.patch | ||
10 | " | 11 | " |
11 | 12 | ||
12 | 13 | ||
@@ -43,4 +44,5 @@ static() { | |||
43 | "$subpkgdir"/sbin/apk.static | 44 | "$subpkgdir"/sbin/apk.static |
44 | } | 45 | } |
45 | 46 | ||
46 | md5sums="191938ff9433745a1e24dfab6f8f7249 apk-tools-2.0.3.tar.bz2" | 47 | md5sums="191938ff9433745a1e24dfab6f8f7249 apk-tools-2.0.3.tar.bz2 |
48 | b4679e85ed85914141312fcbd357bb0f triggers.patch" | ||
diff --git a/main/apk-tools/triggers.patch b/main/apk-tools/triggers.patch new file mode 100644 index 0000000000..4702e0f85a --- /dev/null +++ b/main/apk-tools/triggers.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | commit 60b537e356dfcd0ed9a3516152c6a170912efcef | ||
2 | Author: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Thu Jun 10 17:50:11 2010 +0000 | ||
4 | |||
5 | db: do not free trigger list after package is unpacked | ||
6 | |||
7 | The triggers are read during apk_db_unpack_pkg(). If we delete the | ||
8 | triggers list after then unpack we delete the triggers which is not | ||
9 | what we want. | ||
10 | |||
11 | This fixes bug introduced in ce3cf8bff901e7fcacbca640ffedaeea2b3bdf7f | ||
12 | |||
13 | diff --git a/src/database.c b/src/database.c | ||
14 | index 7421e1b..11864cb 100644 | ||
15 | --- a/src/database.c | ||
16 | +++ b/src/database.c | ||
17 | @@ -2100,6 +2100,12 @@ int apk_db_install_pkg(struct apk_database *db, | ||
18 | |||
19 | /* Install the new stuff */ | ||
20 | ipkg = apk_pkg_install(db, newpkg); | ||
21 | + ipkg->flags |= APK_IPKGF_RUN_ALL_TRIGGERS; | ||
22 | + if (ipkg->triggers->num != 0) { | ||
23 | + list_del(&ipkg->trigger_pkgs_list); | ||
24 | + apk_string_array_free(&ipkg->triggers); | ||
25 | + } | ||
26 | + | ||
27 | if (newpkg->installed_size != 0) { | ||
28 | r = apk_db_unpack_pkg(db, ipkg, (oldpkg != NULL), | ||
29 | (oldpkg == newpkg), cb, cb_ctx, | ||
30 | @@ -2110,12 +2116,6 @@ int apk_db_install_pkg(struct apk_database *db, | ||
31 | } | ||
32 | } | ||
33 | |||
34 | - ipkg->flags |= APK_IPKGF_RUN_ALL_TRIGGERS; | ||
35 | - if (ipkg->triggers->num != 0) { | ||
36 | - list_del(&ipkg->trigger_pkgs_list); | ||
37 | - apk_string_array_free(&ipkg->triggers); | ||
38 | - } | ||
39 | - | ||
40 | if (oldpkg != NULL && oldpkg != newpkg && oldpkg->ipkg != NULL) { | ||
41 | apk_db_purge_pkg(db, oldpkg->ipkg, NULL); | ||
42 | apk_pkg_uninstall(db, oldpkg); | ||