summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody A.W. Somerville <cody.somerville@canonical.com>2009-06-19 08:17:51 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:09:45 +0100
commit3e161e501ef3310434311c94dbcd32516f71bf04 (patch)
tree6829b82057d68b5b71de020256599c471128d667
parent0902d1b76df27b34806515c89281ee5c8cfa36f9 (diff)
downloadlive-build-3e161e501ef3310434311c94dbcd32516f71bf04.zip
live-build-3e161e501ef3310434311c94dbcd32516f71bf04.tar.gz
Simplifying template precedence.
-rwxr-xr-xfunctions/templates.sh17
1 files changed, 4 insertions, 13 deletions
diff --git a/functions/templates.sh b/functions/templates.sh
index 846034b..eec52f3 100755
--- a/functions/templates.sh
+++ b/functions/templates.sh
@@ -11,23 +11,14 @@ Check_templates ()
{
PACKAGE="${1}"
- # Check user defined templates directory
- if [ ! -e "${LH_TEMPLATES}" ]
+ if [ -d "config/templates/${PACKAGE}" ]
then
- if [ -d config/templates ]
- then
- LH_TEMPLATES=config/templates
- else
- Echo_error "templates not accessible in %s nor config/templates" "${LH_TEMPLATES}"
- exit 1
- fi
- fi
-
- if [ -d "${LH_TEMPLATES}/${PACKAGE}" ]
+ TEMPLATES="config/templates/${PACKAGE}"
+ elif [ -d "${LH_TEMPLATES}/${PACKAGE}" ]
then
TEMPLATES="${LH_TEMPLATES}/${PACKAGE}"
else
- Echo_error "%s templates not accessible in %s" "${PACKAGE}" "${LH_TEMPLATES}"
+ Echo_error "%s templates not accessible in %s nor config/templates" "${PACKAGE}" "${LH_TEMPLATES}"
exit 1
fi
}