1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Move file override functions to seperate helper script file

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-05-10 14:42:43 +02:00
parent c6ae50eb40
commit b472ff031a
4 changed files with 56 additions and 56 deletions

View file

@ -10,7 +10,7 @@ export LINUXPKG="linux"
# utilities
source "$SCRIPTDIR/util/depends.sh"
source "$SCRIPTDIR/util/version.sh"
source "$SCRIPTDIR/util/misc.sh"
source "$SCRIPTDIR/util/override.sh"
# check all packages
for pkg in $SCRIPTDIR/pkg/*; do

1
mk.sh
View file

@ -58,6 +58,7 @@ source "$SCRIPTDIR/util/download.sh"
source "$SCRIPTDIR/util/pkgcmd.sh"
source "$SCRIPTDIR/util/toolchain.sh"
source "$SCRIPTDIR/util/misc.sh"
source "$SCRIPTDIR/util/override.sh"
############################## toolchain config ##############################
include_merge "TOOLCHAIN"

View file

@ -1,58 +1,3 @@
file_path_override() {
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
echo "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
return
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
echo "$SCRIPTDIR/product/$PRODUCT/$1"
return
fi
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
echo "$SCRIPTDIR/board/$BOARD/$1"
return
fi
}
cat_file_override() {
local path=$(file_path_override "$1")
if [ ! -z "$path" ]; then
cat "$path"
fi
}
cat_file_merge() {
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/$1"
fi
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
cat "$SCRIPTDIR/board/$BOARD/$1"
fi
}
include_override() {
local path=$(file_path_override "$1")
if [ ! -z "$path" ]; then
source "$path"
fi
}
include_merge() {
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
source "$SCRIPTDIR/board/$BOARD/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
source "$SCRIPTDIR/product/$PRODUCT/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
source "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
fi
}
apply_patches() {
local PATCH

54
util/override.sh Normal file
View file

@ -0,0 +1,54 @@
file_path_override() {
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
echo "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
return
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
echo "$SCRIPTDIR/product/$PRODUCT/$1"
return
fi
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
echo "$SCRIPTDIR/board/$BOARD/$1"
return
fi
}
cat_file_override() {
local path=$(file_path_override "$1")
if [ ! -z "$path" ]; then
cat "$path"
fi
}
cat_file_merge() {
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/$1"
fi
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
cat "$SCRIPTDIR/board/$BOARD/$1"
fi
}
include_override() {
local path=$(file_path_override "$1")
if [ ! -z "$path" ]; then
source "$path"
fi
}
include_merge() {
if [ -e "$SCRIPTDIR/board/$BOARD/$1" ]; then
source "$SCRIPTDIR/board/$BOARD/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$1" ]; then
source "$SCRIPTDIR/product/$PRODUCT/$1"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1" ]; then
source "$SCRIPTDIR/product/$PRODUCT/$BOARD/$1"
fi
}