summaryrefslogtreecommitdiffstats
path: root/main/apk-tools
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-10-31 16:58:35 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-10-31 16:59:16 +0200
commit259ea355754da91be38f7e1c4f86064b02a11788 (patch)
tree38467f7fdcbf6fc8b967219d000c4bc989a14818 /main/apk-tools
parent3bec65c2a515813f60eb25ac55d2d7461d80a4b6 (diff)
downloadaports-259ea355754da91be38f7e1c4f86064b02a11788.tar.bz2
aports-259ea355754da91be38f7e1c4f86064b02a11788.tar.xz
main/apk-tools: upgrade to 2.2.0_rc1
Diffstat (limited to 'main/apk-tools')
-rw-r--r--main/apk-tools/0001-lua-adapt-to-new-API.patch32
-rw-r--r--main/apk-tools/0002-solver-pkg-implement-versioned-conflicts.patch219
-rw-r--r--main/apk-tools/APKBUILD10
3 files changed, 3 insertions, 258 deletions
diff --git a/main/apk-tools/0001-lua-adapt-to-new-API.patch b/main/apk-tools/0001-lua-adapt-to-new-API.patch
deleted file mode 100644
index c4668d96d..000000000
--- a/main/apk-tools/0001-lua-adapt-to-new-API.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From bd0242e1de1c21d4d58cfd86e98b223b6e3e7e12 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Thu, 20 Oct 2011 12:43:12 +0000
-Subject: [PATCH 1/2] lua: adapt to new API
-
-Use new apk_blob_pull_dep instead of the old apk_dep_from_blob
----
- src/lua-apk.c | 7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/lua-apk.c b/src/lua-apk.c
-index 845d67a..e41e785 100644
---- a/src/lua-apk.c
-+++ b/src/lua-apk.c
-@@ -204,10 +204,11 @@ static int Papk_exists(lua_State *L)
- struct apk_dependency dep;
- struct apk_name *name;
- struct apk_package *pkg;
-- int i, r;
-+ int i;
-+ apk_blob_t blob = APK_BLOB_STR(depstr);
-+ apk_blob_pull_dep(&blob, db, &dep);
-
-- r = apk_dep_from_blob(&dep, db, APK_BLOB_STR(depstr));
-- if (r != 0)
-+ if (APK_BLOB_IS_NULL(blob))
- goto ret_nil;
-
- name = dep.name;
---
-1.7.7
-
diff --git a/main/apk-tools/0002-solver-pkg-implement-versioned-conflicts.patch b/main/apk-tools/0002-solver-pkg-implement-versioned-conflicts.patch
deleted file mode 100644
index 802501214..000000000
--- a/main/apk-tools/0002-solver-pkg-implement-versioned-conflicts.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From e682e6596c101d634b3780a98773c8433b3baadb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
-Date: Fri, 21 Oct 2011 15:24:24 -0400
-Subject: [PATCH 2/2] solver, pkg: implement versioned conflicts
-
-One can now say in dependency "!foo<2" which means, that if foo is
-installed, it needs to be >=2, but it's not a required dependency.
----
- src/apk_package.h | 3 ++-
- src/apk_version.h | 1 -
- src/del.c | 3 +--
- src/package.c | 24 ++++++++++++++----------
- src/solver.c | 10 ++++------
- test/conflict.repo | 19 +++++++++++++++++++
- test/conflict1.expect | 2 ++
- test/conflict2.expect | 2 ++
- 8 files changed, 44 insertions(+), 20 deletions(-)
- create mode 100644 test/conflict.repo
- create mode 100644 test/conflict1.expect
- create mode 100644 test/conflict2.expect
-
-diff --git a/src/apk_package.h b/src/apk_package.h
-index 41d65cb..c68fef7 100644
---- a/src/apk_package.h
-+++ b/src/apk_package.h
-@@ -59,7 +59,8 @@ struct apk_sign_ctx {
- struct apk_dependency {
- struct apk_name *name;
- apk_blob_t *version;
-- int result_mask;
-+ unsigned optional : 1;
-+ unsigned result_mask : 3;
- };
- APK_ARRAY(apk_dependency_array, struct apk_dependency);
-
-diff --git a/src/apk_version.h b/src/apk_version.h
-index 8c264e6..514fea9 100644
---- a/src/apk_version.h
-+++ b/src/apk_version.h
-@@ -21,7 +21,6 @@
- #define APK_DEPMASK_REQUIRE (APK_VERSION_EQUAL|APK_VERSION_LESS|\
- APK_VERSION_GREATER)
- #define APK_DEPMASK_CHECKSUM (APK_VERSION_LESS|APK_VERSION_GREATER)
--#define APK_DEPMASK_CONFLICT (0)
-
- const char *apk_version_op_string(int result_mask);
- int apk_version_result_mask(const char *str);
-diff --git a/src/del.c b/src/del.c
-index 3d7ffe7..ffa924f 100644
---- a/src/del.c
-+++ b/src/del.c
-@@ -58,8 +58,7 @@ static void foreach_installed_reverse_dependency(
- for (k = 0; k < pkg0->depends->num; k++) {
- struct apk_dependency *dep = &pkg0->depends->item[k];
- if (dep->name == name &&
-- (dep->result_mask == APK_DEPMASK_CONFLICT ||
-- apk_dep_is_satisfied(dep, pkg)))
-+ apk_dep_is_satisfied(dep, pkg))
- break;
- }
- if (k >= pkg0->depends->num)
-diff --git a/src/package.c b/src/package.c
-index cc4c141..3886d82 100644
---- a/src/package.c
-+++ b/src/package.c
-@@ -195,16 +195,16 @@ void apk_blob_pull_dep(apk_blob_t *b, struct apk_database *db, struct apk_depend
- {
- struct apk_name *name;
- apk_blob_t bname, bop, bver = APK_BLOB_NULL;
-- int mask = APK_DEPMASK_REQUIRE;
-+ int mask = APK_DEPMASK_REQUIRE, optional = 0;
- size_t len;
-
- /* [!]name[<,<=,=,>=,>]ver */
- if (APK_BLOB_IS_NULL(*b))
- goto fail;
- if (b->ptr[0] == '!') {
-- mask = 0;
- b->ptr++;
- b->len--;
-+ optional = 1;
- }
- if (apk_blob_cspn(*b, "<>= ", &bname, &bop)) {
- int i;
-@@ -243,10 +243,14 @@ void apk_blob_pull_dep(apk_blob_t *b, struct apk_database *db, struct apk_depend
- if (name == NULL)
- goto fail;
-
-+ if (optional)
-+ mask ^= APK_DEPMASK_REQUIRE;
-+
- *dep = (struct apk_dependency){
- .name = name,
- .version = apk_blob_atomize_dup(bver),
- .result_mask = mask,
-+ .optional = optional,
- };
- return;
- fail:
-@@ -292,11 +296,8 @@ static int parse_depend(void *ctx, apk_blob_t blob)
-
- int apk_dep_is_satisfied(struct apk_dependency *dep, struct apk_package *pkg)
- {
-- if (pkg == NULL) {
-- if (dep->result_mask == APK_DEPMASK_CONFLICT)
-- return 1;
-- return 0;
-- }
-+ if (pkg == NULL)
-+ return dep->optional;
- if (dep->name != pkg->name)
- return 0;
- if (dep->result_mask == APK_DEPMASK_CHECKSUM) {
-@@ -326,13 +327,16 @@ void apk_blob_pull_deps(apk_blob_t *b, struct apk_database *db, struct apk_depen
-
- void apk_blob_push_dep(apk_blob_t *to, struct apk_dependency *dep)
- {
-- if (dep->result_mask == APK_DEPMASK_CONFLICT)
-+ int result_mask = dep->result_mask;
-+
-+ if (dep->optional) {
- apk_blob_push_blob(to, APK_BLOB_PTR_LEN("!", 1));
-+ result_mask ^= APK_DEPMASK_REQUIRE;
-+ }
-
- apk_blob_push_blob(to, APK_BLOB_STR(dep->name->name));
-
-- if (dep->result_mask != APK_DEPMASK_CONFLICT &&
-- dep->result_mask != APK_DEPMASK_REQUIRE) {
-+ if (!APK_BLOB_IS_NULL(*dep->version)) {
- apk_blob_push_blob(to, APK_BLOB_STR(apk_version_op_string(dep->result_mask)));
- apk_blob_push_blob(to, *dep->version);
- }
-diff --git a/src/solver.c b/src/solver.c
-index 49cfc79..d277bc5 100644
---- a/src/solver.c
-+++ b/src/solver.c
-@@ -126,8 +126,7 @@ static void foreach_dependency_pkg(
- struct apk_package *pkg0 = name0->pkgs->item[j];
-
- /* conflict depends on all to be not installed */
-- if (dep->result_mask != APK_DEPMASK_CONFLICT &&
-- !apk_dep_is_satisfied(dep, pkg0))
-+ if (!apk_dep_is_satisfied(dep, pkg0))
- continue;
-
- cb(ss, pkg0);
-@@ -154,8 +153,7 @@ static void foreach_rinstall_if_pkg(
- for (k = 0; k < pkg0->install_if->num; k++) {
- struct apk_dependency *dep = &pkg0->install_if->item[k];
- if (dep->name == name &&
-- (dep->result_mask == APK_DEPMASK_CONFLICT ||
-- apk_dep_is_satisfied(dep, pkg)))
-+ apk_dep_is_satisfied(dep, pkg))
- break;
- }
- if (k >= pkg0->install_if->num)
-@@ -635,7 +633,7 @@ static void apply_constraint(struct apk_solver_state *ss, struct apk_dependency
- if (ss->latest_decision != NULL)
- inherit_name_state(name, ss->latest_decision->name);
-
-- if (dep->result_mask != APK_DEPMASK_CONFLICT)
-+ if (!dep->optional)
- ns->requirers++;
- update_name_state(ss, name);
- }
-@@ -675,7 +673,7 @@ static void undo_constraint(struct apk_solver_state *ss, struct apk_dependency *
- if (ss->latest_decision && has_inherited_state(ss->latest_decision->name))
- recalculate_inherted_name_state(name);
-
-- if (dep->result_mask != APK_DEPMASK_CONFLICT)
-+ if (!dep->optional)
- ns->requirers--;
- update_name_state(ss, name);
- }
-diff --git a/test/conflict.repo b/test/conflict.repo
-new file mode 100644
-index 0000000..a95658c
---- /dev/null
-+++ b/test/conflict.repo
-@@ -0,0 +1,19 @@
-+C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
-+P:a
-+V:1
-+S:1
-+I:1
-+D:!b<2
-+
-+C:Q1C4uoV7SdMdDhYg4OCVmI71D8HIA=
-+P:b
-+V:1
-+S:1
-+I:1
-+
-+C:Q1hdUpqRv5mYgJEqW52UmVsvmyysE=
-+P:b
-+V:2
-+S:1
-+I:1
-+
-diff --git a/test/conflict1.expect b/test/conflict1.expect
-new file mode 100644
-index 0000000..03c6d67
---- /dev/null
-+++ b/test/conflict1.expect
-@@ -0,0 +1,2 @@
-+Installing b (2)
-+Installing a (1)
-diff --git a/test/conflict2.expect b/test/conflict2.expect
-new file mode 100644
-index 0000000..250f942
---- /dev/null
-+++ b/test/conflict2.expect
-@@ -0,0 +1,2 @@
-+1 unsatisfiable dependencies (solution with 2 names)
-+world: b<2
---
-1.7.7
-
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index e371c5be7..6a034a23e 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,14 +1,12 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
-pkgver=2.2.0_pre1
-pkgrel=2
+pkgver=2.2.0_rc1
+pkgrel=0
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static lua-apk:luaapk"
depends=
makedepends="zlib-dev openssl-dev lua-dev"
source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
- 0001-lua-adapt-to-new-API.patch
- 0002-solver-pkg-implement-versioned-conflicts.patch
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
@@ -56,6 +54,4 @@ luaapk() {
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
}
-md5sums="cda5172b66e7778b855dfda44e5f174f apk-tools-2.2.0_pre1.tar.bz2
-2e8538b8d46c9888cd6adde5212a7217 0001-lua-adapt-to-new-API.patch
-8894f1cfc751b441910db949a7c33178 0002-solver-pkg-implement-versioned-conflicts.patch"
+md5sums="a2829e24a18537ecdcb4740395142e95 apk-tools-2.2.0_rc1.tar.bz2"