mirror of
https://github.com/pygos/build.git
synced 2024-11-25 20:30:43 +01:00
b4824a9f29
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
58 lines
875 B
Bash
58 lines
875 B
Bash
file_path_override() {
|
|
local layer
|
|
|
|
if [ -z "$LAYERCONF" ]; then
|
|
return
|
|
fi
|
|
|
|
tac "$LAYERCONF" | while read layer; do
|
|
if [ -e "$SCRIPTDIR/layer/$layer/$1" ]; then
|
|
echo "$SCRIPTDIR/layer/$layer/$1"
|
|
return
|
|
fi
|
|
done
|
|
}
|
|
|
|
cat_file_override() {
|
|
local path=$(file_path_override "$1")
|
|
|
|
if [ ! -z "$path" ]; then
|
|
cat "$path"
|
|
fi
|
|
}
|
|
|
|
cat_file_merge() {
|
|
local layer
|
|
|
|
if [ -z "$LAYERCONF" ]; then
|
|
return
|
|
fi
|
|
|
|
while read layer; do
|
|
if [ -e "$SCRIPTDIR/layer/$layer/$1" ]; then
|
|
cat "$SCRIPTDIR/layer/$layer/$1"
|
|
fi
|
|
done < "$LAYERCONF"
|
|
}
|
|
|
|
include_override() {
|
|
local path=$(file_path_override "$1")
|
|
|
|
if [ ! -z "$path" ]; then
|
|
source "$path"
|
|
fi
|
|
}
|
|
|
|
include_merge() {
|
|
local layer
|
|
|
|
if [ -z "$LAYERCONF" ]; then
|
|
return
|
|
fi
|
|
|
|
while read layer; do
|
|
if [ -e "$SCRIPTDIR/layer/$layer/$1" ]; then
|
|
source "$SCRIPTDIR/layer/$layer/$1"
|
|
fi
|
|
done < "$LAYERCONF"
|
|
}
|