diff --git a/bpm_utils/package_utils.go b/bpm_utils/package_utils.go index 8d65c6a..4f13f8d 100644 --- a/bpm_utils/package_utils.go +++ b/bpm_utils/package_utils.go @@ -611,10 +611,13 @@ func compilePackage(pkgInfo *PackageInfo, filename, rootDir string, binaryPkgFro runScript := ` cd "$BPM_WORKDIR" + +set -a source "source.sh" +set +a + if [[ $(type -t prepare) == function ]]; then echo "Running prepare() function..." - export -f prepare bash -e -c prepare if [ $? -ne 0 ]; then echo "Failed to run prepare() function in source.sh" @@ -623,7 +626,6 @@ fi cd "$BPM_SOURCE" if [[ $(type -t build) == function ]]; then echo "Running build() function..." - export -f build bash -e -c build if [ $? -ne 0 ]; then echo "Failed to run build() function in source.sh" @@ -632,7 +634,6 @@ fi cd "$BPM_SOURCE" if [[ $(type -t check) == function ]]; then echo "Running check() function..." - export -f check bash -e -c check if [ $? -ne 0 ]; then echo "Failed to run check() function in source.sh" @@ -643,7 +644,6 @@ if ! [[ $(type -t package) == function ]]; then exit 1 fi echo "Running package() function..." -export -f package bash -e -c package if [ $? -ne 0 ]; then echo "Failed to run package() function in source.sh" diff --git a/test_packages/x86_64/bpm/bpm.bpm b/test_packages/x86_64/bpm/bpm.bpm index 5bd5879..476435c 100644 Binary files a/test_packages/x86_64/bpm/bpm.bpm and b/test_packages/x86_64/bpm/bpm.bpm differ diff --git a/test_packages/x86_64/bpm/files/usr/bin/bpm b/test_packages/x86_64/bpm/files/usr/bin/bpm index adab9ee..2d80fe6 100755 Binary files a/test_packages/x86_64/bpm/files/usr/bin/bpm and b/test_packages/x86_64/bpm/files/usr/bin/bpm differ