Merge pull request #310485 from martinetd/syft

syft: disable update check
This commit is contained in:
Aleksana 2024-05-21 20:49:56 +08:00 committed by GitHub
commit 7075e69645
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -42,6 +42,12 @@ buildGoModule rec {
"-X=main.gitTreeState=clean"
];
postPatch = ''
# Don't check for updates.
substituteInPlace cmd/syft/internal/options/update_check.go \
--replace-fail "CheckForAppUpdate: true" "CheckForAppUpdate: false"
'';
preBuild = ''
ldflags+=" -X main.gitCommit=$(cat COMMIT)"
ldflags+=" -X main.buildDate=$(cat SOURCE_DATE_EPOCH)"
@ -51,9 +57,6 @@ buildGoModule rec {
doCheck = false;
postInstall = ''
# avoid update checks when generating completions
export SYFT_CHECK_FOR_APP_UPDATE=false
installShellCompletion --cmd syft \
--bash <($out/bin/syft completion bash) \
--fish <($out/bin/syft completion fish) \
@ -64,7 +67,6 @@ buildGoModule rec {
installCheckPhase = ''
runHook preInstallCheck
export SYFT_CHECK_FOR_APP_UPDATE=false
$out/bin/syft --help
$out/bin/syft version | grep "${version}"