difos/package/system/apk/patches/0010-app_list-add-full-print.patch
Eric Fahlgren f244ff22d9 apk-tools: update to git HEAD (2025-06-06)
3efd75dc7e49 crypto: fix segfault when passing --hash
51306cf1424e test: export APK_CONFIG=/dev/null
b91e9e17ceb6 build: mark scdoc dependency as native
123fa05b787a build: mark lua interpreter dependency as native
5fbb85426ea0 libfetch: fix fetch_err* for negative error codes
1458737d58c2 db, index: fix 'index' loading of old index
cbd1e6b49add add: use solver error when arch is incompatible
f66d84fcd42d doc: update apk-package(5) regarding arch validation
f5df274d248c test: don't use temporary files for diffing output
42034f7961f0 apk: allow per-applet option to override group options
b6ca99d44119 serializer: start_array(num=-1) indicates unknown amount
14881b9ffb2e query: a new api and applet to search and output information
dd2255e10ee9 package: use apk_array_foreach
ae17b61de83b info: use apk_array_foreach
6d4471f55ada solver: use apk_array_foreach
7951798121c1 db: use apk_array_foreach
5e3cac4ccb85 commit: use apk_array_foreach
86c725d97afd db: allocate protected paths with balloc
0fe23ce1a501 array: make apk_array_foreach* evaluate end only once
a50f7ea2dd02 io_url_wget: correctly init wget_out on apk_io_url_init call
2cdfdd86e3d4 commit: Fix 'upgrade' typo on cache-pre-download
3fb50f645203 Add man page for protected_paths.d
652a1365aa30 fetch: account existing files to progress
0257acf6b120 doc: remove .d from apk-protected_paths(5) man page name
aeb74de67818 db: include index file name for APK_REPOTYPE_NDX
6ec4fe6fa334 mkpkg: handle apk_blob_split failure
c47b6e17fe6d extract: handle apk_blob_split failure
b7c6b0b468d7 mkpkg: print error message when using forbidden fields
b9483c46bdf9 fetch: fix APK_BLOB_STRLIT used with char argument
d495be9e9f25 adbsign: fix recompressing when alg is NONE or level is 0
5348babed78e mkndx: fix memory leak when with large dependency list in v2 packages
11dd5923f6a1 mkndx: don't return ADB_ERROR from mkndx_parse_v2meta
8415dbf6df42 mkndx: reset pkginfo on error
684bef440cde mkndx: remove workaround for abuild license field
a94fa1878df9 pkg: move same origin check after replaces check
3abcd400bdbf pkg: fix package repos after 16th missing
216ac57b7a1a arch: reserve wasi32 architecture name for WASI APKs
3761e38d1a00 add wasi32/wasi64 reservations to apk-package(5)
68c1fa58113e dot: only initialize qs->mode.empty_matches_all once
56019c5ed390 {blob,tar,adb}: avoid overflow when pulling numbers
5112b60c4440 index: only check file name for old index
345863787484 db: fix ${name} check in apk_db_get_pkg_by_name
5ce64d14ead8 manifest: replace memset 0 with apk_blob_pushed
7765f134215d info: include name and version when --all is used
d2ca47f9f3b4 fix indentation
33c822e93267 build: install apk_repoparser.h header
0762b25eb2ad ctx: initialize progress_char in apk_ctx_init
0a3fa796a532 doc: fix typos
10a184f3f43d search: fix incorrect error when no match was found
aa9502dc3720 ctx: fix closing of root_fd
2ac55a0f26bd io: fix id_cache when root_fd is 0
c39b22fe49c7 fetch: fix outdir_fd when openat returns 0
9d42be2316fc meson: Build Python module using standard Meson python build functions
48c6e526ee6f meson: Allow overriding the names of the Lua binary and pkgconfig file
249f0d937afb ci: Add build test on Fedora Linux
10dbdf7263eb pkg: replace files/dirs from packages that will be removed
acae571db2b9 pkg: apk_pkg_replaces_{dir,file} access ipkgs consistently
8b0b567544b7 io: initialize 'r' in apk_dir_foreach_config_file
55ab583de9a3 io: fix undefined behaviour in apk_istream_get_delim
deadab38aea9 db: flush progress notes after opening indexes
32b3a448c3e2 info: always show name/version for no-legacy-info
dbba5797269b crypto: make crypto backend an implementation detail
c0288de355e6 test: fix failing tests due to missing PATH_MAX definition
1863ccbf7abb make: remove -DCRYPTO_USE_*
e2fb020c96ca apk: shared error message for invalid arguments
29040298f5de adb: fix handling of empty adb blocks
2aa08ec9da6a adb: fix exact comparison of objects containing arrays
e475a2fab226 Update apk-v3.5.scd
76c629d79473 doc: combine --no-* and --* descriptions
afc1ee46ca55 mkpkg: convert --rootnode to APK_OPT_BOOL
2c52e9415653 pkg: correctly check empty atoms in apk_package
f384d7d11229 test: add tests for query
0c044cb8323d tests: fix permissions on replaces.sh
31bc2263a10f defines: make BIT() always return a 64-bit type
dc86ad784eef solver: always resolve conflict names in install-if
8b6e9c9d6421 db, pkg: separate "virtual" repository for command line packages
d7f77eb68aa5 adb: reduce alignment of ADB_TYPE_INT_64 to 32 bits
1ffd648aca45 array: generalize apk_deps_balloc to apk_array_balloc
2089f8a8225b adb, pkg, query: add support for 'recommends'
59c207b582cc array: generalize apk_deps_bclone to apk_array_bclone
617ba801f760 commit: fix size_diff on package removal
649859806c65 commit, upgrade: never suggest --force-broken-world
4f84ee8156e1 help: group option group help first
44a7498d6102 fetch: fix error reporting if package is not selected
7516cf61fe94 adb: return bool from adb_block_is_ext
f47cb4bdac15 adb: validate signature header version specific size
1925de55beef adb, pkg: add support for custom tags
f174f287b1b2 db, doc: update and document environment variables for scripts
603eeea614b5 upgrade: improve the mechanism to detect self-upgrade done
97c2d3318d8d upgrade: determine apk-tools package name from /proc/self/exe
088f88cdb6a5 build, test: fix limits.h including and testing selfupgrade
8acf4c0e95da pkg: export APK_PACKAGE for package scripts
ab907a6b682e io: ignore dot files in apk_dir_foreach_file()
f5e4cbc3900e info: make --legacy-info the default for the time being
7f1afedb7cae doc/apk-v3(5): document that multiple SIG blocks are allowed
2204c49b9d7e adb: validate block type before testing the allowed mask
9331888de6bd apk-tools-3.0.0_rc5

Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19043
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 10:41:01 +02:00

94 lines
3 KiB
Diff

From f74ca42e0fa5bf131644a46d8259edd493bf072c Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Wed, 23 Oct 2024 01:11:01 +0200
Subject: [PATCH] app_list: add full print
Add full print variant to dump info about each package.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
src/app_list.c | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
--- a/src/app_list.c
+++ b/src/app_list.c
@@ -49,12 +49,53 @@ struct list_ctx {
unsigned int match_providers : 1;
unsigned int match_depends : 1;
unsigned int manifest : 1;
+ unsigned int installed : 1; /* Solely for print_full patch */
+ unsigned int full : 1;
};
+static void print_full(const struct apk_package *pkg, const struct list_ctx *ctx)
+{
+ struct apk_dependency d;
+
+ printf("Package: %s\n", pkg->name->name);
+ printf("Version: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->version));
+ if (apk_array_len(pkg->depends)) {
+ int i = 0;
+
+ printf("Depends: ");
+ apk_array_foreach(d, pkg->depends) {
+ i++;
+ printf("%s%s", d->name->name, i < apk_array_len(pkg->depends) ? ", ": "\n");
+ }
+ }
+ if (apk_array_len(pkg->provides)) {
+ int i = 0;
+
+ printf("Provides: ");
+ apk_array_foreach(d, pkg->provides) {
+ i++;
+ printf("%s%s", d->name->name, i < apk_array_len(pkg->provides) ? ", ": "\n");
+ }
+ }
+ if (pkg->ipkg && ctx->installed)
+ printf("Status: install ok %s\n", pkg->marked ? "hold" : "installed");
+ if (pkg->description)
+ printf("Description: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->description));
+ printf("License: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->license));
+ printf("Installed-Size: %zu\n", pkg->installed_size);
+ printf("Size: %zu\n", pkg->size);
+ printf("\n");
+}
+
static void print_package(const struct apk_database *db, const struct apk_name *name, const struct apk_package *pkg, const struct list_ctx *ctx)
{
if (ctx->match_providers) printf("<%s> ", name->name);
+ if (ctx->full) {
+ print_full(pkg, ctx);
+ return;
+ }
+
if (ctx->manifest) {
printf("%s " BLOB_FMT "\n", pkg->name->name, BLOB_PRINTF(*pkg->version));
return;
@@ -96,6 +137,7 @@ static void print_package(const struct apk_database *db, const struct apk_name *
OPT(OPT_LIST_depends, APK_OPT_SH("d") "depends") \
OPT(OPT_LIST_installed, APK_OPT_SH("I")) \
OPT(OPT_LIST_manifest, "manifest") \
+ OPT(OPT_LIST_full, "full") \
OPT(OPT_LIST_origin, APK_OPT_SH("o") "origin") \
OPT(OPT_LIST_orphaned, APK_OPT_SH("O")) \
OPT(OPT_LIST_providers, APK_OPT_SH("P") "providers") \
@@ -109,6 +151,9 @@ static int list_parse_option(void *pctx, struct apk_ctx *ac, int opt, const char
struct apk_query_spec *qs = &ac->query;
switch (opt) {
+ case OPT_LIST_full:
+ ctx->full = 1;
+ break;
case OPT_LIST_available:
qs->filter.available = 1;
break;
@@ -117,6 +162,7 @@ static int list_parse_option(void *pctx, struct apk_ctx *ac, int opt, const char
break;
case OPT_LIST_installed:
installed:
+ ctx->installed = 1;
qs->filter.installed = 1;
ac->open_flags |= APK_OPENF_NO_SYS_REPOS;
break;