summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-09-04 01:18:07 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-09-04 04:17:34 +0200
commit1558dfbf3b2a42f43594acf6e3d8f9b329ff1133 (patch)
tree79d61f2560d84c8d06b81fe49969fb261796e084
parent984cbd4eb023001668eea530e2b5ed2e57ba3693 (diff)
downloadmkinitcpio-1558dfbf3b2a42f43594acf6e3d8f9b329ff1133.tar.gz
mkinitcpio-1558dfbf3b2a42f43594acf6e3d8f9b329ff1133.tar.xz
Exit with error if PRESETS seems to be defined as an array.
Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xmkinitcpio8
1 files changed, 6 insertions, 2 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 1b40867..fad9499 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -113,6 +113,8 @@ while getopts ':c:k:s:b:g:a:p:m:vH:LMhS:' arg; do
done
shift $((${OPTIND} - 1))
+. "${FUNCTIONS}"
+
# use preset $PRESET
if [ -n "${PRESET}" ]; then
if [ -f "${PRESETDIR}/${PRESET}.preset" ]; then
@@ -130,6 +132,10 @@ if [ -n "${PRESET}" ]; then
# Build all images
echo "==> Using ${PRESETDIR}/${PRESET}.preset"
+ if grep -q "PRESETS=(" ${PRESETDIR}/${PRESET}.preset; then
+ die "Invalid definition of PRESETS."
+ fi
+
. ${PRESETDIR}/${PRESET}.preset
for p in ${PRESETS}; do
@@ -224,8 +230,6 @@ fi
BASEDIR=$(echo ${BASEDIR} | tr -s /)
MODULEDIR=$(echo ${MODULEDIR} | tr -s /)
-. "${FUNCTIONS}"
-
if [ "${SHOW_AUTOMODS}" = "y" ]; then
echo "Modules autodetected:"
. "${INSTDIR}/autodetect"