diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 177aea7b08..ae85c2dcf1 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -22,15 +22,20 @@ log_err() echo "$1" 1>&2 } +# Get the real command not hooked by sonic-build-hook package get_command() { - local path=$(echo $PATH | sed 's#[^:]*buildinfo/scripts:##' | sed "s#/usr/sbin:##") + # Change the PATH env to get the real command by excluding the command in the hooked folders + local path=$(echo $PATH | sed 's#[^:]*buildinfo/scripts:##' | sed "s#/usr/local/sbin:##") local command=$(PATH=$path which $1) echo $command } check_version_control() { + # The env variable SONIC_VERSION_CONTROL_COMPONENTS examples: + # all -- match all components + # py2,py3,deb -- match py2, py3 and deb only if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,$1,* ]]; then echo "y" else diff --git a/src/sonic-build-hooks/scripts/symlink_build_hooks b/src/sonic-build-hooks/scripts/symlink_build_hooks index 7218575ee9..2ce5ec2772 100755 --- a/src/sonic-build-hooks/scripts/symlink_build_hooks +++ b/src/sonic-build-hooks/scripts/symlink_build_hooks @@ -1,7 +1,7 @@ #!/bin/bash HOOK_PATH=/usr/local/share/buildinfo/hooks -TARGET_PATH=/usr/sbin +TARGET_PATH=/usr/local/sbin FILES=$(ls $HOOK_PATH) usage()