summaryrefslogtreecommitdiff
path: root/system/apk-tools
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-06-01 06:31:25 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-06-01 06:31:25 +0000
commit9aa1902242ec14138d24f99f9e062f233ca57d57 (patch)
tree488edac8345c18dfda1384f8dc4744b9df74f7c6 /system/apk-tools
parent6f7b06393dc434ca7acc03d11f08e52e1bfe813a (diff)
downloadpackages-9aa1902242ec14138d24f99f9e062f233ca57d57.tar.gz
packages-9aa1902242ec14138d24f99f9e062f233ca57d57.tar.bz2
packages-9aa1902242ec14138d24f99f9e062f233ca57d57.tar.xz
packages-9aa1902242ec14138d24f99f9e062f233ca57d57.zip
system/apk-tools: add --deep to upgrade applet
Diffstat (limited to 'system/apk-tools')
-rw-r--r--system/apk-tools/APKBUILD4
-rw-r--r--system/apk-tools/deep.patch84
2 files changed, 87 insertions, 1 deletions
diff --git a/system/apk-tools/APKBUILD b/system/apk-tools/APKBUILD
index 10360db6a..d9e29a241 100644
--- a/system/apk-tools/APKBUILD
+++ b/system/apk-tools/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=apk-tools
pkgver=2.10.3
-pkgrel=1
+pkgrel=2
pkgdesc="Alpine Package Keeper - package manager"
url="https://git.alpinelinux.org/cgit/apk-tools/"
arch="all"
@@ -13,6 +13,7 @@ makedepends_host="zlib-dev openssl openssl-dev linux-headers"
makedepends="$makedepends_build $makedepends_host"
subpackages="$pkgname-static"
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
+ deep.patch
list.patch
pmmx.patch
"
@@ -69,5 +70,6 @@ static() {
}
sha512sums="1b190cfd04c69369bd4f2b708d4df0f8cf2937e1580c95138fd2c2257e7604d015deaca10a9fe0da6742981caadb6b067c15e417a1951866f781b8a5c71c98ee apk-tools-2.10.3.tar.xz
+a89007da158cbca67d5c18df2f117958604d69bf49251ccd11052457d5926eebe3d6573dfca238bd246e64661a7e373b1853fd226e4cca34c148195e688ae846 deep.patch
53d446734d32341cbd9ca00aedcd65d4d99220da354a9339837a6c79609a321f61ae917fb3cd9d4bffebcfc171d06c0f0d315e29a2d16285545c4fa085a75639 list.patch
746d00ce2af554a25db7ecea2b0a4d8f7399d2560efb6bf59ea144012d0163d3e0bad84c799bd706e8be6c0a543d4e35728d6beb269fddbbea626384009129cb pmmx.patch"
diff --git a/system/apk-tools/deep.patch b/system/apk-tools/deep.patch
new file mode 100644
index 000000000..f315339cc
--- /dev/null
+++ b/system/apk-tools/deep.patch
@@ -0,0 +1,84 @@
+From e61635ada7901763919caeaa01fa62ead3f6e97f Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Fri, 31 May 2019 21:32:02 -0500
+Subject: [PATCH 1/1] upgrade: add --deep option to upgrade everything
+
+---
+ src/apk_solver.h | 1 +
+ src/solver.c | 10 ++++++++++
+ src/upgrade.c | 5 +++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/src/apk_solver.h b/src/apk_solver.h
+index b8b072d..908b3fd 100644
+--- a/src/apk_solver.h
++++ b/src/apk_solver.h
+@@ -35,6 +35,7 @@ struct apk_changeset {
+ #define APK_SOLVERF_REINSTALL 0x0004
+ #define APK_SOLVERF_LATEST 0x0008
+ #define APK_SOLVERF_IGNORE_CONFLICT 0x0010
++#define APK_SOLVERF_DEEP 0x0020
+
+ void apk_solver_set_name_flags(struct apk_name *name,
+ unsigned short solver_flags,
+diff --git a/src/solver.c b/src/solver.c
+index e10cf8b..8437d61 100644
+--- a/src/solver.c
++++ b/src/solver.c
+@@ -40,6 +40,7 @@ struct apk_solver_state {
+ unsigned int pinning_inherit;
+ unsigned int default_repos;
+ unsigned ignore_conflict : 1;
++ unsigned deep_upgrade : 1;
+ };
+
+ static struct apk_provider provider_none = {
+@@ -510,6 +511,14 @@ static int compare_providers(struct apk_solver_state *ss,
+ unsigned int solver_flags;
+ int r;
+
++ /* In deep upgrades, always return the greater version */
++ if (ss->deep_upgrade)
++ switch (apk_version_compare_blob(*pA->version, *pB->version)) {
++ case APK_VERSION_LESS:
++ return -1;
++ case APK_VERSION_GREATER:
++ return 1;
++ }
+
+ /* Prefer existing package */
+ if (pkgA == NULL || pkgB == NULL)
+@@ -1006,6 +1015,7 @@ restart:
+ ss->changeset = changeset;
+ ss->default_repos = apk_db_get_pinning_mask_repos(db, APK_DEFAULT_PINNING_MASK);
+ ss->ignore_conflict = !!(solver_flags & APK_SOLVERF_IGNORE_CONFLICT);
++ ss->deep_upgrade = !!(solver_flags & APK_SOLVERF_DEEP);
+ list_init(&ss->dirty_head);
+ list_init(&ss->unresolved_head);
+
+diff --git a/src/upgrade.c b/src/upgrade.c
+index 14457b5..e48d8e3 100644
+--- a/src/upgrade.c
++++ b/src/upgrade.c
+@@ -38,6 +38,9 @@ static int option_parse_applet(void *ctx, struct apk_db_options *dbopts, int opt
+ case 'a':
+ uctx->solver_flags |= APK_SOLVERF_AVAILABLE;
+ break;
++ case 'd':
++ uctx->solver_flags |= APK_SOLVERF_DEEP;
++ break;
+ case 'l':
+ uctx->solver_flags |= APK_SOLVERF_LATEST;
+ break;
+@@ -59,6 +62,8 @@ static const struct apk_option options_applet[] = {
+ { 0x10000, "no-self-upgrade",
+ "Do not do early upgrade of 'apk-tools' package" },
+ { 0x10001, "self-upgrade-only", "Only do self-upgrade" },
++ { 'd', "deep",
++ "Include dependencies when upgrading world" },
+ };
+
+ static const struct apk_option_group optgroup_applet = {
+--
+2.21.0
+