[build] add SKIP_BUILD_HOOK support for curl (#15923)

#### Why I did it
To support SKIP_BUILD_HOOK for curl command so the targets downloaded by curl (SONIC_ONLINE_DEBS, SONIC_ONLINE_FILES) can utilize it.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Add a logic to invoke a real command instead of a `download_packages()` (the same way it's done for wget)

#### How to verify it
Add an online target (with URL attribute).
Add the "SKIP_VERSION=y" to this target.
Check that download_packages is not invoked.
This commit is contained in:
Yakiv Huryk 2023-08-28 23:25:06 +03:00 committed by GitHub
parent 44d52dbb8b
commit d0a40afcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,4 +3,9 @@
. /usr/local/share/buildinfo/scripts/buildinfo_base.sh
[ -z $REAL_COMMAND ] && REAL_COMMAND=/usr/bin/curl
if [ "$SKIP_BUILD_HOOK" == y ]; then
$REAL_COMMAND "$@"
exit $?
fi
REAL_COMMAND=$REAL_COMMAND download_packages "$@"