]> git.sur5r.net Git - kconfig-frontends/commitdiff
ksync: fix error message when no kernel path is provided
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun, 22 Jan 2012 18:26:34 +0000 (19:26 +0100)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Sun, 22 Jan 2012 18:26:34 +0000 (19:26 +0100)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
ksync.sh

index 85b6ce18b22e6214b368888bdfc5e6392b662394..7af9ac04ef96b608d61f2242c33f60b4f0a898b3 100755 (executable)
--- a/ksync.sh
+++ b/ksync.sh
@@ -4,8 +4,8 @@ my_name="${0##*/}"
 
 # If an argument is given, it's the location
 # of the Linux kernel source tree
-if [ -n "${1}" -a -d "${1}/kernel" ]; then
-    k_dir="${1}"
+k_dir="${1}"
+if [ -n "${k_dir}" -a -d "${k_dir}/kernel" ]; then
     # Get the version
     eval $( head -n 5 "${k_dir}/Makefile"               \
             |sed -r -e 's/^/K_/; s/ = ?/="/; s/$/"/;'   \
@@ -14,7 +14,7 @@ if [ -n "${1}" -a -d "${1}/kernel" ]; then
           "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}"  \
           "${K_EXTRAVERSION}" "${K_NAME}"
 else
-    if [ -z "${1}" ]; then
+    if [ -n "${k_dir}" ]; then
         printf "%s: \`%s': not a Linux kernel source tree\n"    \
                "${my_name}" "${k_dir}"
     else