Skip to content
Snippets Groups Projects
Commit 980edcea authored by alice's avatar alice
Browse files

main/apk-tools: fix apk dot

parent 5b1687ac
No related branches found
No related tags found
No related merge requests found
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools pkgname=apk-tools
pkgver=2.14.0_rc1 pkgver=2.14.0_rc1
pkgrel=0 pkgrel=1
pkgdesc="Alpine Package Keeper - package manager for alpine" pkgdesc="Alpine Package Keeper - package manager for alpine"
arch="all" arch="all"
url="https://gitlab.alpinelinux.org/alpine/apk-tools" url="https://gitlab.alpinelinux.org/alpine/apk-tools"
...@@ -23,6 +23,7 @@ if [ "$CBUILD" = "$CHOST" ]; then ...@@ -23,6 +23,7 @@ if [ "$CBUILD" = "$CHOST" ]; then
depends="$depends ca-certificates-bundle" depends="$depends ca-certificates-bundle"
fi fi
source="https://gitlab.alpinelinux.org/alpine/apk-tools/-/archive/v$pkgver/apk-tools-v$pkgver.tar.gz source="https://gitlab.alpinelinux.org/alpine/apk-tools/-/archive/v$pkgver/apk-tools-v$pkgver.tar.gz
fix-dot.patch
_apk _apk
" "
builddir="$srcdir/$pkgname-v$pkgver" builddir="$srcdir/$pkgname-v$pkgver"
...@@ -87,5 +88,6 @@ luaapk() { ...@@ -87,5 +88,6 @@ luaapk() {
sha512sums=" sha512sums="
331fc7e456ead99466f3179ee32ae4fc64ea8691ff4ab8e076f92b1070f112310222427a88084d4309a912a216641a5fa957cf878b58a0acfa2168c7685e1d70 apk-tools-v2.14.0_rc1.tar.gz 331fc7e456ead99466f3179ee32ae4fc64ea8691ff4ab8e076f92b1070f112310222427a88084d4309a912a216641a5fa957cf878b58a0acfa2168c7685e1d70 apk-tools-v2.14.0_rc1.tar.gz
1af412f7bf4927a312e7068e58eaa675f26cc47c3e096b028c44eafc16b3c92b5ae9a51d93c4c1b45c1c772a0d68c658acabf7b2352448f6e464b93bfbf8a498 fix-dot.patch
7870676720f5007eee9482786e02246f8e3474afb90e76c9c83aebe914747a8e007b5d2eed6441933f4922024b3f0664db270f21981ad6c2db877a110b0cd79e _apk 7870676720f5007eee9482786e02246f8e3474afb90e76c9c83aebe914747a8e007b5d2eed6441933f4922024b3f0664db270f21981ad6c2db877a110b0cd79e _apk
" "
From 06fef8ad8a936269a1868cbe1421ac72797f9a3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 26 Apr 2023 13:13:32 +0300
Subject: [PATCH] db: fix apk_db_foreach_matching_name to match all without
args
This is a fixup to the backport commit 67f5a753:
db, apps: sort display results based on package names
This makes apk_db_foreach_matching_name() act consistently on
between 2.14-stable and master. And updates the call sites where
differing behaviour is needed, and fixes dot and other call sites
to work again.
fixes #10893
---
src/app_del.c | 2 +-
src/app_fetch.c | 6 ++++--
src/database.c | 4 ++--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/app_del.c b/src/app_del.c
index 06deb437..e5c6aabd 100644
--- a/src/app_del.c
+++ b/src/app_del.c
@@ -145,7 +145,7 @@ static int del_main(void *pctx, struct apk_database *db, struct apk_string_array
int r = 0;
apk_dependency_array_copy(&ctx->world, db->world);
- apk_db_foreach_matching_name(db, args, delete_name, ctx);
+ if (args->num) apk_db_foreach_matching_name(db, args, delete_name, ctx);
if (ctx->errors) return ctx->errors;
r = apk_solver_solve(db, 0, ctx->world, &changeset);
diff --git a/src/app_fetch.c b/src/app_fetch.c
index 11602c18..58afff43 100644
--- a/src/app_fetch.c
+++ b/src/app_fetch.c
@@ -370,12 +370,14 @@ static int fetch_main(void *pctx, struct apk_database *db, struct apk_string_arr
apk_dependency_array_init(&ctx->world);
foreach_array_item(dep, db->world)
mark_dep_flags(ctx, dep);
- apk_db_foreach_matching_name(db, args, mark_name_flags, ctx);
+ if (args->num)
+ apk_db_foreach_matching_name(db, args, mark_name_flags, ctx);
if (ctx->errors == 0)
mark_names_recursive(db, args, ctx);
apk_dependency_array_free(&ctx->world);
} else {
- apk_db_foreach_matching_name(db, args, mark_name, ctx);
+ if (args->num)
+ apk_db_foreach_matching_name(db, args, mark_name, ctx);
}
if (!ctx->errors)
apk_db_foreach_sorted_package(db, NULL, fetch_package, ctx);
diff --git a/src/database.c b/src/database.c
index d7f197b9..48b5f17d 100644
--- a/src/database.c
+++ b/src/database.c
@@ -3049,14 +3049,14 @@ int apk_db_foreach_matching_name(struct apk_database *db, struct apk_string_arra
struct apk_name *name;
struct match_ctx mctx = {
.db = db,
- .filter = filter,
.cb = cb,
.cb_ctx = ctx,
};
int r;
- if (!filter || !filter->num) return 0;
+ if (!filter || !filter->num) goto all;
+ mctx.filter = filter;
foreach_array_item(pmatch, filter)
if (strchr(*pmatch, '*') != NULL)
goto all;
--
GitLab
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment