helpers.sh: add 5th argument, directory to cd into

This commit is contained in:
fosslinux 2021-04-13 22:34:11 +10:00
parent cd361e63f7
commit c05c16e12c
1 changed files with 3 additions and 1 deletions

View File

@ -17,10 +17,12 @@ export PATH=/after/bin
# 2) optionally specify build script. Default is name-version.sh
# 3) optionally specify name of checksum file. Default is checksums
# 4) directory of patches. Default is patches
# 5) directory to cd into. Default is ${pkg}
build () {
pkg=$1
script_name=${2:-${pkg}.sh}
checksum_f=${3:-checksums}
dirname=${5:-${pkg}}
cd "${PREFIX}/${pkg}" || (echo "Cannot cd into ${pkg}!"; kill $$)
echo "${pkg}: beginning build using script ${script_name}"
@ -44,7 +46,7 @@ build () {
build_stage=src_unpack
call $build_stage
cd "${pkg}" || (echo "Cannot cd into build/${pkg}!"; kill $$)
cd "${dirname}" || (echo "Cannot cd into build/${dirname}!"; kill $$)
echo "${pkg}: preparing source."
build_stage=src_prepare