aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-05-26 15:12:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-05-26 15:12:15 +0000
commitf12146d5ba7a85010295e4142ca35d9ea1588fb2 (patch)
tree3b296b5889a716a5c3904c8e044f8f3658d9f448 /main
parent4dc9bf2acd6573e4599a07be2f3fa1da418642ff (diff)
downloadaports-f12146d5ba7a85010295e4142ca35d9ea1588fb2.tar.bz2
aports-f12146d5ba7a85010295e4142ca35d9ea1588fb2.tar.xz
main/apk-tools: backprt more patches from upstream
Diffstat (limited to 'main')
-rw-r--r--main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch (renamed from main/apk-tools/info-segfault.patch)19
-rw-r--r--main/apk-tools/0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch42
-rw-r--r--main/apk-tools/0003-search-add-search-for-reverse-dependencies-in-index.patch221
-rw-r--r--main/apk-tools/0004-package-don-t-leak-signing-key-file-fd.patch (renamed from main/apk-tools/0001-package-don-t-leak-signing-key-file-fd.patch)2
-rw-r--r--main/apk-tools/0005-cache-display-more-than-one-error.patch55
-rw-r--r--main/apk-tools/APKBUILD16
6 files changed, 342 insertions, 13 deletions
diff --git a/main/apk-tools/info-segfault.patch b/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
index 9479fade30..4df956bf36 100644
--- a/main/apk-tools/info-segfault.patch
+++ b/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
@@ -1,11 +1,13 @@
-commit 87420aaf295f58847332ba3aa89691a0259baace
-Author: Timo Teras <timo.teras@iki.fi>
-Date: Wed May 5 08:56:06 2010 +0300
+From 87420aaf295f58847332ba3aa89691a0259baace Mon Sep 17 00:00:00 2001
+From: Timo Teras <timo.teras@iki.fi>
+Date: Wed, 5 May 2010 08:56:06 +0300
+Subject: [PATCH 1/5] info: fix querying of removed, but referenced packages
- info: fix querying of removed, but referenced packages
-
- Check that package name has packages associated with it before
- dereferencing the pointer. Fixes #345.
+Check that package name has packages associated with it before
+dereferencing the pointer. Fixes #345.
+---
+ src/info.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/info.c b/src/info.c
index 7ca486c..d944fca 100644
@@ -20,3 +22,6 @@ index 7ca486c..d944fca 100644
apk_error("Not found: %s", argv[i]);
return 1;
}
+--
+1.7.1
+
diff --git a/main/apk-tools/0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch b/main/apk-tools/0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch
new file mode 100644
index 0000000000..2e20152ddf
--- /dev/null
+++ b/main/apk-tools/0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch
@@ -0,0 +1,42 @@
+From 47bac8c29c9a3c3fbebfd20e907170f24f9d677c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 11 May 2010 09:31:20 +0000
+Subject: [PATCH 2/5] upgrade: reset versioned deps in world when doing upgrade -a
+
+Doing "apk add file.apk" adds a versioned dependency to allow
+downgrading, and sticky version. Most often this is to install
+single packages from newer repository. So it would make sense
+to reset them to non-versioned if doing:
+
+ apk upgrade -a
+
+fixes #346
+---
+ src/upgrade.c | 9 +++++++--
+ 1 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/upgrade.c b/src/upgrade.c
+index f91e8cc..879e14c 100644
+--- a/src/upgrade.c
++++ b/src/upgrade.c
+@@ -41,10 +41,15 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
+ goto err;
+
+ for (i = 0; i < db->world->num; i++) {
+- r = apk_state_lock_dependency(state, &db->world->item[i]);
++ struct apk_dependency *dep = &db->world->item[i];
++ if (dep->version && (apk_flags & APK_PREFER_AVAILABLE)) {
++ dep->result_mask = APK_VERSION_EQUAL | APK_VERSION_LESS | APK_VERSION_GREATER;
++ dep->version = NULL;
++ }
++ r = apk_state_lock_dependency(state, dep);
+ if (r != 0) {
+ apk_error("Unable to upgrade '%s'",
+- db->world->item[i].name->name);
++ dep->name->name);
+ goto err;
+ }
+ }
+--
+1.7.1
+
diff --git a/main/apk-tools/0003-search-add-search-for-reverse-dependencies-in-index.patch b/main/apk-tools/0003-search-add-search-for-reverse-dependencies-in-index.patch
new file mode 100644
index 0000000000..f2947c635a
--- /dev/null
+++ b/main/apk-tools/0003-search-add-search-for-reverse-dependencies-in-index.patch
@@ -0,0 +1,221 @@
+From d9bf4aabff801164b4c54e51b38c5f6eab2da114 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Wed, 19 May 2010 16:48:40 +0300
+Subject: [PATCH 3/5] search: add search for reverse dependencies in index
+
+So it'll be easier to rebuild affected packages. Fixes #349.
+---
+ src/search.c | 148 +++++++++++++++++++++++++++++++++++----------------------
+ 1 files changed, 91 insertions(+), 57 deletions(-)
+
+diff --git a/src/search.c b/src/search.c
+index 91c2913..e5e5d55 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -18,18 +18,14 @@
+ #include "apk_state.h"
+
+ struct search_ctx {
+- int (*action)(struct apk_database *db, int argc, char **argv);
++ int (*match)(struct apk_package *pkg, const char *str);
++ int (*print)(struct apk_package *pkg);
++ int argc;
++ char **argv;
+ };
+
+-struct search_query_ctx {
+- struct apk_database *db;
+- const char *query;
+-};
+-
+-static int search_list_print(apk_hash_item item, void *ctx)
++static int print_match(struct apk_package *pkg)
+ {
+- struct apk_package *pkg = (struct apk_package *) item;
+-
+ printf("%s", pkg->name->name);
+ if (apk_verbosity > 0)
+ printf("-%s", pkg->version);
+@@ -41,61 +37,50 @@ static int search_list_print(apk_hash_item item, void *ctx)
+ return 0;
+ }
+
+-static int search_query_print(apk_hash_item item, void *ctx)
++static int print_rdepends(struct apk_package *pkg)
+ {
+- struct search_query_ctx *ictx = (struct search_query_ctx *) ctx;
+- struct apk_package *pkg = (struct apk_package *) item;
++ struct apk_name *name, *name0;
++ struct apk_package *pkg0;
++ struct apk_dependency *dep;
++ int i, j, k;
+
+- if (fnmatch(ictx->query, pkg->name->name, 0) != 0)
++ name = pkg->name;
++ if (name->rdepends == NULL)
+ return 0;
+- search_list_print(item, ictx->db);
+-
+- return 0;
+-}
+-
+-static int search_list(struct apk_database *db, int argc, char **argv)
+-{
+- int i;
+- struct search_query_ctx ctx;
+-
+- ctx.db = db;
+
+- if (argc == 0)
+- apk_hash_foreach(&db->available.packages, search_list_print, db);
+- else
+- for (i=0; i<argc; i++) {
+- ctx.query = argv[i];
+- apk_hash_foreach(&db->available.packages, search_query_print, &ctx);
++ printf("%s-%s:", pkg->name->name, pkg->version);
++ for (i = 0; i < name->rdepends->num; i++) {
++ name0 = name->rdepends->item[i];
++ if (name0->pkgs == NULL)
++ continue;
++ for (j = 0; j < name0->pkgs->num; j++) {
++ pkg0 = name0->pkgs->item[j];
++ if (pkg0->depends == NULL)
++ continue;
++ for (k = 0; k < pkg0->depends->num; k++) {
++ dep = &pkg0->depends->item[k];
++ if (name == dep->name &&
++ (apk_version_compare(pkg->version, dep->version)
++ & dep->result_mask)) {
++ printf(" %s-%s", pkg0->name->name, pkg0->version);
++ }
++ }
+ }
++ }
++ printf("\n");
+
+ return 0;
+ }
+
+-static int search_query_desc_print(apk_hash_item item, void *ctx)
++static int search_pkgname(struct apk_package *pkg, const char *str)
+ {
+- struct search_query_ctx *ictx = (struct search_query_ctx *) ctx;
+- struct apk_package *pkg = (struct apk_package *) item;
+-
+- if( strstr(pkg->description, ictx->query) == NULL )
+- return 0;
+- search_list_print(item, ictx->db);
+-
+- return 0;
++ return fnmatch(str, pkg->name->name, 0) == 0;
+ }
+
+-static int search_desc(struct apk_database *db, int argc, char **argv)
++static int search_desc(struct apk_package *pkg, const char *str)
+ {
+- int i;
+- struct search_query_ctx ctx;
+-
+- ctx.db = db;
+-
+- for (i=0; i<argc; i++) {
+- ctx.query = argv[i];
+- apk_hash_foreach(&db->available.packages, search_query_desc_print, &ctx);
+- }
+-
+- return 0;
++ return strstr(pkg->name->name, str) != NULL ||
++ strstr(pkg->description, str) != NULL;
+ }
+
+ static int search_parse(void *ctx, struct apk_db_options *dbopts,
+@@ -105,7 +90,10 @@ static int search_parse(void *ctx, struct apk_db_options *dbopts,
+
+ switch (optch) {
+ case 'd':
+- ictx->action = search_desc;
++ ictx->match = search_desc;
++ break;
++ case 'r':
++ ictx->print = print_rdepends;
+ break;
+ default:
+ return -1;
+@@ -113,23 +101,69 @@ static int search_parse(void *ctx, struct apk_db_options *dbopts,
+ return 0;
+ }
+
++static int match_packages(apk_hash_item item, void *ctx)
++{
++ struct search_ctx *ictx = (struct search_ctx *) ctx;
++ struct apk_package *pkg = (struct apk_package *) item;
++ int i;
++
++ for (i = 0; i < ictx->argc; i++)
++ if (ictx->match(pkg, ictx->argv[i]))
++ break;
++ if (ictx->argc == 0 || i < ictx->argc)
++ ictx->print(pkg);
++
++ return 0;
++}
++
+ static int search_main(void *ctx, struct apk_database *db, int argc, char **argv)
+ {
+ struct search_ctx *ictx = (struct search_ctx *) ctx;
++ struct apk_name *name;
++ int rc = 0, i, j, slow_search;
++
++ slow_search = ictx->match != NULL || argc == 0;
++ if (!slow_search) {
++ for (i = 0; i < argc; i++)
++ if (strcspn(argv[i], "*?[") != strlen(argv[i])) {
++ slow_search = 1;
++ break;
++ }
++ }
++
++ if (ictx->match == NULL)
++ ictx->match = search_pkgname;
++ if (ictx->print == NULL)
++ ictx->print = print_match;
++ else if (argc == 0)
++ return -1;
+
+- if (ictx->action != NULL)
+- return ictx->action(db, argc, argv);
++ if (slow_search) {
++ ictx->argc = argc;
++ ictx->argv = argv;
++ rc = apk_hash_foreach(&db->available.packages,
++ match_packages, ictx);
++ } else {
++ for (i = 0; i < argc; i++) {
++ name = apk_db_query_name(db, APK_BLOB_STR(argv[i]));
++ if (name == NULL || name->pkgs == NULL)
++ continue;
++ for (j = 0; j < name->pkgs->num; j++)
++ ictx->print(name->pkgs->item[j]);
++ }
++ }
+
+- return search_list(db, argc, argv);
++ return rc;
+ }
+
+ static struct apk_option search_options[] = {
+- { 'd', "description", "Search also package descriptions" },
++ { 'd', "description", "Search also package descriptions" },
++ { 'r', "rdepends", "Print reverse dependencies of package" },
+ };
+
+ static struct apk_applet apk_search = {
+ .name = "search",
+- .help = "Search package names (and descriptions) by wildcard PATTERN.",
++ .help = "Search package by PATTERNs or by indexed dependencies.",
+ .arguments = "PATTERN",
+ .open_flags = APK_OPENF_READ | APK_OPENF_NO_STATE,
+ .context_size = sizeof(struct search_ctx),
+--
+1.7.1
+
diff --git a/main/apk-tools/0001-package-don-t-leak-signing-key-file-fd.patch b/main/apk-tools/0004-package-don-t-leak-signing-key-file-fd.patch
index 6ff88a312c..818eeb1e79 100644
--- a/main/apk-tools/0001-package-don-t-leak-signing-key-file-fd.patch
+++ b/main/apk-tools/0004-package-don-t-leak-signing-key-file-fd.patch
@@ -1,7 +1,7 @@
From fe55da70741621f7bac2cd943b64cc13e25f9427 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 26 May 2010 14:30:08 +0300
-Subject: [PATCH] package: don't leak signing key file fd
+Subject: [PATCH 4/5] package: don't leak signing key file fd
openssl BIO does not close the fd unless we explicitly tell it to
do so.
diff --git a/main/apk-tools/0005-cache-display-more-than-one-error.patch b/main/apk-tools/0005-cache-display-more-than-one-error.patch
new file mode 100644
index 0000000000..6e85218b18
--- /dev/null
+++ b/main/apk-tools/0005-cache-display-more-than-one-error.patch
@@ -0,0 +1,55 @@
+From d21303960544b5f11b7d69d0335f0903fb93d180 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 13 May 2010 09:26:19 +0000
+Subject: [PATCH 5/5] cache: display more than one error
+
+Display all packages that are bad in world rather than only first
+before exiting.
+---
+ src/cache.c | 15 ++++++++-------
+ 1 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/src/cache.c b/src/cache.c
+index 85d9777..49a71fa 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -30,7 +30,7 @@ static int cache_download(struct apk_database *db)
+ struct apk_package *pkg;
+ struct apk_repository *repo;
+ char item[PATH_MAX], cacheitem[PATH_MAX];
+- int i, r = 0;
++ int i, r = 0, errors = 0;
+
+ if (db->world == NULL)
+ return 0;
+@@ -41,12 +41,13 @@ static int cache_download(struct apk_database *db)
+
+ for (i = 0; i < db->world->num; i++) {
+ r = apk_state_lock_dependency(state, &db->world->item[i]);
+- if (r != 0) {
+- apk_error("Unable to select version for '%s': %d",
+- db->world->item[i].name->name, r);
+- goto err;
+- }
++ errors += r;
++ if (r != 0)
++ apk_error("Unable to select version for '%s'",
++ db->world->item[i].name->name);
+ }
++ if (errors)
++ goto err;
+
+ list_for_each_entry(change, &state->change_list_head, change_list) {
+ pkg = change->newpkg;
+@@ -67,7 +68,7 @@ static int cache_download(struct apk_database *db)
+ err:
+ if (state != NULL)
+ apk_state_unref(state);
+- return r;
++ return errors;
+ }
+
+ static int cache_clean(struct apk_database *db)
+--
+1.7.1
+
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index edf083e885..07b602dfaf 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,14 +1,17 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.0.2
-pkgrel=5
+pkgrel=6
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static"
depends=
makedepends="zlib-dev openssl-dev pkgconfig"
source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
- info-segfault.patch
- 0001-package-don-t-leak-signing-key-file-fd.patch
+ 0001-info-fix-querying-of-removed-but-referenced-packages.patch
+ 0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch
+ 0003-search-add-search-for-reverse-dependencies-in-index.patch
+ 0004-package-don-t-leak-signing-key-file-fd.patch
+ 0005-cache-display-more-than-one-error.patch
"
@@ -46,5 +49,8 @@ static() {
}
md5sums="c87cb88f90eb8d7021d37e3b5386863d apk-tools-2.0.2.tar.bz2
-aeab86a00119f9945edd6d3c3a8bb9c1 info-segfault.patch
-ac2ddef3f82f700c9eb536a54050cca6 0001-package-don-t-leak-signing-key-file-fd.patch"
+c590e894c2580cbb092b150fca9af3cf 0001-info-fix-querying-of-removed-but-referenced-packages.patch
+5c53eaa29dd9722c25b6878cde392d05 0002-upgrade-reset-versioned-deps-in-world-when-doing-upg.patch
+6baca299fbf00b97f78fa8fbd0e82f5b 0003-search-add-search-for-reverse-dependencies-in-index.patch
+175470e6d5b2d20fe02d6fb61f8ec6d1 0004-package-don-t-leak-signing-key-file-fd.patch
+0ab64b75b09f37b4d265df3f7b5b7e83 0005-cache-display-more-than-one-error.patch"