aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2012-08-12 20:43:02 +0200
committerSebastian Pipping <sebastian@pipping.org>2012-08-12 20:47:54 +0200
commit47ac46c0c64ac7d13c3c1e460891ae52352e4eea (patch)
tree976996a7adf4abe518c422d58d3e021e5469f05e
parentReport on sourced config files (diff)
downloadgenkernel-47ac46c0c64ac7d13c3c1e460891ae52352e4eea.tar.gz
genkernel-47ac46c0c64ac7d13c3c1e460891ae52352e4eea.tar.bz2
genkernel-47ac46c0c64ac7d13c3c1e460891ae52352e4eea.zip
Fix parsing of --config=... command line option
Before, --config=... could not be combined with anything else on the command line
-rw-r--r--ChangeLog3
-rwxr-xr-xgenkernel11
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 79a318b..bee9ecb 100644
--- 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
diff --git a/genkernel b/genkernel
index 5ee2d42..98f24d9 100755
--- 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}