1 |
commit: b4a90d77ea10bf9ca993c7b464d4d789535e1577 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jul 29 13:47:45 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 29 20:02:21 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b4a90d77 |
7 |
|
8 |
gen_determineargs.sh: determine_real_args(): Don't allow TMPDIR with spaces |
9 |
|
10 |
This just won't work -- many packages like util-linux don't support spaces |
11 |
in builddir path and will fail when applying libtool magic. |
12 |
|
13 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
14 |
|
15 |
gen_determineargs.sh | 7 +++++++ |
16 |
gen_funcs.sh | 16 ++++++++++++++++ |
17 |
2 files changed, 23 insertions(+) |
18 |
|
19 |
diff --git a/gen_determineargs.sh b/gen_determineargs.sh |
20 |
index b64cdba..9170080 100755 |
21 |
--- a/gen_determineargs.sh |
22 |
+++ b/gen_determineargs.sh |
23 |
@@ -380,6 +380,13 @@ determine_real_args() { |
24 |
|
25 |
dump_debugcache |
26 |
|
27 |
+ if isTrue "$(has_space_characters "${TMPDIR}")" |
28 |
+ then |
29 |
+ # Packages like util-linux will fail to compile when path to |
30 |
+ # build dir contains spaces |
31 |
+ gen_die "--tmpdir '${TMPDIR}' contains space character(s) which are not supported!" |
32 |
+ fi |
33 |
+ |
34 |
if [ ! -d "${TMPDIR}" ] |
35 |
then |
36 |
mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!" |
37 |
|
38 |
diff --git a/gen_funcs.sh b/gen_funcs.sh |
39 |
index e700ae1..c042513 100755 |
40 |
--- a/gen_funcs.sh |
41 |
+++ b/gen_funcs.sh |
42 |
@@ -209,6 +209,22 @@ can_run_programs_compiled_by_genkernel() { |
43 |
echo "${can_run_programs}" |
44 |
} |
45 |
|
46 |
+has_space_characters() { |
47 |
+ [[ ${#} -ne 1 ]] \ |
48 |
+ && gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly one argument (${#} given)!" |
49 |
+ |
50 |
+ local testvalue=${1} |
51 |
+ local has_space_characters=no |
52 |
+ |
53 |
+ local space_pattern='[[:space:]]' |
54 |
+ if [[ "${testvalue}" =~ ${space_pattern} ]] |
55 |
+ then |
56 |
+ has_space_characters=yes |
57 |
+ fi |
58 |
+ |
59 |
+ echo "${has_space_characters}" |
60 |
+} |
61 |
+ |
62 |
is_gzipped() { |
63 |
[[ ${#} -ne 1 ]] \ |
64 |
&& gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly one argument (${#} given)!" |