commit: 0a29fabd3246599c3b5884440c3dfa8afac0c277
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 1 13:43:13 2020 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Aug 1 20:34:59 2020 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0a29fabd
genkernel: Move grep/zgrep check to determine_real_args()
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
gen_determineargs.sh | 14 ++++++++++++++
genkernel | 10 ----------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index d145d16..d8f3028 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -279,6 +279,20 @@ determine_real_args() {
gen_die "'realpath -m /' failed. We need a realpath version
which supports '-m' mode!"
fi
+ if hash grep &>/dev/null
+ then
+ GREP_CMD=grep
+ else
+ gen_die "grep not found. Is sys-apps/grep installed?"
+ fi
+
+ if hash zgrep &>/dev/null
+ then
+ ZGREP_CMD=zgrep
+ else
+ print_warning 1 "zgrep not found. Is app-arch/gzip installed?
You will be unable to use compressed config files!"
+ fi
+
print_info 4 "Resolving config file, command line, and arch default
settings."
# Dest / Config File
Command Line Arch Default
diff --git a/genkernel b/genkernel
index 1a12bbb..c7b90d8 100755
--- a/genkernel
+++ b/genkernel
@@ -112,16 +112,6 @@ print_info 1 "Using genkernel configuration from
'${_GENKERNEL_CONF}' ..."
unset _GENKERNEL_CONF
print_info 1 "Running with options: ${GK_OPTIONS}"
-if ! hash grep &>/dev/null
-then
- gen_die "grep not found. Is sys-apps/grep installed?"
-fi
-
-if ! hash zgrep &>/dev/null
-then
- print_warning 1 "zgrep not found. Is app-arch/gzip installed? You will
be unable to use compressed config files!"
-fi
-
# Save any customizations of MODULES_* first.
override_module_vars="$(compgen -A variable |grep '^MODULES_')"
for v in ${override_module_vars}