diff options
-rw-r--r-- | main/apk-tools/0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch | 65 | ||||
-rw-r--r-- | main/apk-tools/APKBUILD | 6 |
2 files changed, 69 insertions, 2 deletions
diff --git a/main/apk-tools/0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch b/main/apk-tools/0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch new file mode 100644 index 0000000000..b28bb381c7 --- /dev/null +++ b/main/apk-tools/0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch @@ -0,0 +1,65 @@ +From ba7b50c0f8ac7c8a88b03856037d9ca6618cccd5 Mon Sep 17 00:00:00 2001 +From: William Pitcock <nenolod@dereferenced.org> +Date: Thu, 27 Apr 2017 23:23:47 +0000 +Subject: [PATCH] solver: don't clobber package swaps in cases where an + installed package is being replaced by a provider + +--- + src/solver.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/src/solver.c b/src/solver.c +index 248fa27..5c08887 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -727,7 +727,12 @@ static void cset_track_deps_removed(struct apk_solver_state *ss, struct apk_pack + + static void cset_check_removal_by_deps(struct apk_solver_state *ss, struct apk_package *pkg) + { +- if (pkg->name->ss.requirers == 0) ++ /* NOTE: an orphaned package name may have 0 requirers because it is now being satisfied ++ * through an alternate provider. In these cases, we will handle this later as an adjustment ++ * operation using cset_gen_name_change(). As such, only insert a removal into the transaction ++ * if there is no other resolved provider. ++ */ ++ if (pkg->name->ss.requirers == 0 && pkg->name->ss.chosen.pkg == NULL) + cset_gen_name_remove(ss, pkg); + } + +@@ -775,12 +780,16 @@ static void cset_gen_name_change(struct apk_solver_state *ss, struct apk_name *n + if (name->ss.in_changeset) return; + + pkg = name->ss.chosen.pkg; +- if (pkg == NULL) { +- /* Package removal */ ++ if (pkg == NULL || pkg->name != name) { ++ /* Original package dependency name was orphaned, emit a removal. ++ * See cset_gen_name_remove() for more details. */ + opkg = name->ss.installed_pkg; + if (opkg) cset_gen_name_remove(ss, opkg); + name->ss.in_changeset = 1; +- return; ++ ++ /* If a replacement is not provided, then we're done here. */ ++ if (pkg == NULL) ++ return; + } + if (pkg->ss.in_changeset) return; + +@@ -881,8 +890,12 @@ static void generate_changeset(struct apk_solver_state *ss, struct apk_dependenc + foreach_array_item(d, world) + cset_gen_dep(ss, NULL, d); + ++ /* NOTE: We used to call cset_gen_name_remove() directly here. While slightly faster, this clobbered ++ * dependency nodes where a new package was provided under a different name (using provides). As such, ++ * treat everything as a change first and then call cset_gen_name_remove() from there if appropriate. ++ */ + list_for_each_entry(ipkg, &ss->db->installed.packages, installed_pkgs_list) +- cset_gen_name_remove(ss, ipkg->pkg); ++ cset_gen_name_change(ss, ipkg->pkg->name); + + changeset->num_total_changes = + changeset->num_install + +-- +2.12.2 + diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index 0a2fdc1e51..6e91b6b557 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=apk-tools pkgver=2.7.0 -pkgrel=4 +pkgrel=5 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= @@ -17,6 +17,7 @@ source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz 0001-db-prevent-umount-proc-when-it-was-mounted-by-someon.patch 0002-db-catch-asprintf-failure.patch 0001-print-print-warnings-and-errors-to-stderr.patch + 0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch " url="http://git.alpinelinux.org/cgit/apk-tools/" @@ -90,4 +91,5 @@ sha512sums="e6bb4bdada76f5d18b9a6ec8981b4619dd2e2a517ff3248693a5b2743286e2ee605d a05a462982518093f2cb8d82fee3970cc8e0d46736a46679a9369e95497cca26fd2c3493bc86ebc0513757529fa9aa6b954bbf5b24992f92839573758b977cf7 0001-commit-include-limits.h-for-PATH_MAX.patch 2c2dceb8101bd9c42800a2fcdc7f22d546c548adcf860887992ad87b0246444729c56c29b2daafcd3af6ec0f92da4cba8e10506ac8c8b9024f31482033d0026d 0001-db-prevent-umount-proc-when-it-was-mounted-by-someon.patch 21764f250f682698f21b5453f5e66c4b2722585d28196ebee61360e69b07967408fff40a27fd7215d123869694f54f5cece4b23c944f4d950eca1f47cfa97501 0002-db-catch-asprintf-failure.patch -f4c6b940b1464cc4e8e671402232ff747c0fed7e45438d90a60f2489510955e5eba4fc81fee1fd050de0a82c9cc30487a3441d2a06c871a9cd38730acb725e9e 0001-print-print-warnings-and-errors-to-stderr.patch" +f4c6b940b1464cc4e8e671402232ff747c0fed7e45438d90a60f2489510955e5eba4fc81fee1fd050de0a82c9cc30487a3441d2a06c871a9cd38730acb725e9e 0001-print-print-warnings-and-errors-to-stderr.patch +ecd3006ed9c0002aa26edf60df5f80a48e070af42af45b6a149c65931e711e4602999b1d6086497f14f9bdfc3d3b2cd06d2c74bd07e8c3fde763cdcc66d49dce 0001-solver-don-t-clobber-package-swaps-in-cases-where-an.patch" |