From: Pavel Valena Date: Fri, 25 Mar 2022 15:20:16 +0000 (+0100) Subject: fix(dracut-install): do not fail when SOURCE is optional and missing X-Git-Tag: 057~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd1a5ca9ae9e347061e67e51be29335ab074ad95;p=thirdparty%2Fdracut.git fix(dracut-install): do not fail when SOURCE is optional and missing When running dracut-install with '-o' (optional source), and nullglob at the same time, when all of the arguments evaluate , dracut-install should not fail even when the source is not specified. --- diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c index 9a53be158..d7a1cd9b6 100644 --- a/src/install/dracut-install.c +++ b/src/install/dracut-install.c @@ -1175,8 +1175,12 @@ static int parse_argv(int argc, char *argv[]) } if (!optind || optind == argc) { - log_error("No SOURCE argument given"); - usage(EXIT_FAILURE); + if (!arg_optional) { + log_error("No SOURCE argument given"); + usage(EXIT_FAILURE); + } else { + exit(EXIT_SUCCESS); + } } return 1;