Fix parsing of --config=... command line option
authorSebastian Pipping <sebastian@pipping.org>
Sun, 12 Aug 2012 18:43:02 +0000 (20:43 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 12 Aug 2012 18:47:54 +0000 (20:47 +0200)
Before, --config=... could not be combined with anything else on the command line

ChangeLog
genkernel

index 79a318ba93a48cb8fbbffec5ae91d66041d75faa..bee9ecb6b7fe28709b27df31751c08ab47b39a8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 # Distributed under the GPL v2
 # $Id$
 
+  12 Aug 2012; Sebastian Pipping <sping@gentoo.org> genkernel:
+  Fix parsing of --config=... command line option
+
   27 Jul 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts,
   genkernel:
   Bump version to 3.4.40
index 5ee2d4226a306554ddf1b1d88f13b9fbe30a8e33..98f24d9a097cd006cd1a6b91577392259b90a2e2 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -25,11 +25,12 @@ parse_opt() {
 
 # We don't know where our config is, so we check for it, and default to using
 # /etc/genkernel.conf if nobody has specified one.
-case "$*" in
-       --config=*)
-               CMD_GK_CONFIG=`parse_opt "$*"`
-       ;;
-esac
+
+# NOTE: We are look for --config=... in a way that doesn't modify $@ since we access that again, later
+for (( i=1; i<=$# ; i=i+1 )); do
+       eval arg="\$$i"
+       [[ "${arg}" = --config=* ]] && CMD_GK_CONFIG=`parse_opt "${arg}"`
+done
 
 # Pull in our configuration
 _GENKERNEL_CONF=${CMD_GK_CONFIG:-/etc/genkernel.conf}