summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-12-04 12:47:40 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:50:01 +0200
commit06f0ed87bac21947c4d62bcf85e09c0a31874a18 (patch)
tree8518243c3c5011b1bacef83a1f0ffc38c67f0a42 /scripts
parenta70409e1f23b0158785083d977db2e93ed1da4c0 (diff)
downloadvyos-live-build-06f0ed87bac21947c4d62bcf85e09c0a31874a18.tar.gz
vyos-live-build-06f0ed87bac21947c4d62bcf85e09c0a31874a18.zip
Ensuring that functions are either sources locally or globally, but not both.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 21ff520d8..2e4a79ec8 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -6,11 +6,18 @@ then
export LIVE_BUILD
fi
-# Source global functions
-for FUNCTION in "${LIVE_BUILD}"/functions/*.sh /usr/share/live/build/functions/*.sh
+for _DIRECTORY in "${LIVE_BUILD}/functions" /usr/share/live/build/functions
do
- if [ -e "${FUNCTION}" ]
+ if [ -e "${_DIRECTORY}" ]
then
- . "${FUNCTION}"
+ for _FILE in "${_DIRECTORY}"/*.sh
+ do
+ if [ -e "${_FILE}" ]
+ then
+ . "${_FILE}"
+ fi
+ done
+
+ break
fi
done