From bd156836703e52166c282a0fea50a45498cfabdd Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Sat, 7 Aug 2021 08:31:31 -0400 Subject: [PATCH] add: warn when creating empty virtual packages see https://gitlab.alpinelinux.org/alpine/aports/-/issues/11736 [TT: minor stylistic change] --- src/app_add.c | 2 ++ test/basic8.test | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app_add.c b/src/app_add.c index 345fd7a..214bf67 100644 --- a/src/app_add.c +++ b/src/app_add.c @@ -147,6 +147,8 @@ static int add_main(void *ctx, struct apk_ctx *ac, struct apk_string_array *args virtdep.result_mask = APK_VERSION_EQUAL; virtdep.version = virtpkg->version; + + if (!args->num) apk_warn(out, "creating empty virtual package"); } foreach_array_item(parg, args) { diff --git a/test/basic8.test b/test/basic8.test index 19d3964..0042371 100644 --- a/test/basic8.test +++ b/test/basic8.test @@ -2,5 +2,6 @@ --no-network add -t .virtual @EXPECT +WARNING: creating empty virtual package (1/1) Installing .virtual (20190603.131426) OK: 0 MiB in 0 packages