[PATCH] Revert "main: assume --modversion insted of --version if other flags or module names are provided"
Andre Heider
a.heider at gmail.com
Wed Nov 27 09:21:42 EST 2019
This reverts commit 12a0eb124cea85586e57f33c91a1e4c73459eef6.
This "user friendly" behavior is actually detrimental. pkg-config is very
often wrapped in a shell script of cross-compiling toolchains. Such wrappers
may pass extra arguments, such as --static, (reasonably) not expecting that
to break --version. Some build systems (meson being one example) use
--version to determine whether pkg-config is usable. Naturally, the wrappers
fail this test, even though they would've worked with the original pkg-config.
Fixes #6
---
cli/main.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/cli/main.c b/cli/main.c
index 563ec8f..fc698a4 100644
--- a/cli/main.c
+++ b/cli/main.c
@@ -1005,18 +1005,8 @@ main(int argc, char *argv[])
if ((want_flags & PKG_VERSION) == PKG_VERSION)
{
- if (argc > 2)
- {
- fprintf(stderr, "%s: --version specified with other options or module names, assuming --modversion.\n", argv[0]);
-
- want_flags &= ~PKG_VERSION;
- want_flags |= PKG_MODVERSION;
- }
- else
- {
- version();
- return EXIT_SUCCESS;
- }
+ version();
+ return EXIT_SUCCESS;
}
if ((want_flags & PKG_HELP) == PKG_HELP)
--
2.24.0
--------------927702D1A41EA9E43905CD32
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
--------------927702D1A41EA9E43905CD32--
More information about the openwrt-devel
mailing list