1 |
commit: 0a29fabd3246599c3b5884440c3dfa8afac0c277 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 1 13:43:13 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 1 20:34:59 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0a29fabd |
7 |
|
8 |
genkernel: Move grep/zgrep check to determine_real_args() |
9 |
|
10 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
11 |
|
12 |
gen_determineargs.sh | 14 ++++++++++++++ |
13 |
genkernel | 10 ---------- |
14 |
2 files changed, 14 insertions(+), 10 deletions(-) |
15 |
|
16 |
diff --git a/gen_determineargs.sh b/gen_determineargs.sh |
17 |
index d145d16..d8f3028 100755 |
18 |
--- a/gen_determineargs.sh |
19 |
+++ b/gen_determineargs.sh |
20 |
@@ -279,6 +279,20 @@ determine_real_args() { |
21 |
gen_die "'realpath -m /' failed. We need a realpath version which supports '-m' mode!" |
22 |
fi |
23 |
|
24 |
+ if hash grep &>/dev/null |
25 |
+ then |
26 |
+ GREP_CMD=grep |
27 |
+ else |
28 |
+ gen_die "grep not found. Is sys-apps/grep installed?" |
29 |
+ fi |
30 |
+ |
31 |
+ if hash zgrep &>/dev/null |
32 |
+ then |
33 |
+ ZGREP_CMD=zgrep |
34 |
+ else |
35 |
+ print_warning 1 "zgrep not found. Is app-arch/gzip installed? You will be unable to use compressed config files!" |
36 |
+ fi |
37 |
+ |
38 |
print_info 4 "Resolving config file, command line, and arch default settings." |
39 |
|
40 |
# Dest / Config File Command Line Arch Default |
41 |
|
42 |
diff --git a/genkernel b/genkernel |
43 |
index 1a12bbb..c7b90d8 100755 |
44 |
--- a/genkernel |
45 |
+++ b/genkernel |
46 |
@@ -112,16 +112,6 @@ print_info 1 "Using genkernel configuration from '${_GENKERNEL_CONF}' ..." |
47 |
unset _GENKERNEL_CONF |
48 |
print_info 1 "Running with options: ${GK_OPTIONS}" |
49 |
|
50 |
-if ! hash grep &>/dev/null |
51 |
-then |
52 |
- gen_die "grep not found. Is sys-apps/grep installed?" |
53 |
-fi |
54 |
- |
55 |
-if ! hash zgrep &>/dev/null |
56 |
-then |
57 |
- print_warning 1 "zgrep not found. Is app-arch/gzip installed? You will be unable to use compressed config files!" |
58 |
-fi |
59 |
- |
60 |
# Save any customizations of MODULES_* first. |
61 |
override_module_vars="$(compgen -A variable |grep '^MODULES_')" |
62 |
for v in ${override_module_vars} |