diff options
author | 06kellyjac <dev@j-k.io> | 2022-03-17 18:53:00 +0000 |
---|---|---|
committer | 06kellyjac <dev@j-k.io> | 2022-03-17 18:53:00 +0000 |
commit | aa4ed228e5d69150567725296d896c91892ae533 (patch) | |
tree | 5bd943e82b7bd79ea8584ac9033dd9737786e554 /pkgs/tools/security | |
parent | 5855ff74f511423e3e2646248598b3ffff229223 (diff) | |
download | nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar.gz nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar.bz2 nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar.lz nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar.xz nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.tar.zst nixpkgs-aa4ed228e5d69150567725296d896c91892ae533.zip |
grype: 0.34.2 -> 0.34.3
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r-- | pkgs/tools/security/grype/default.nix | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/pkgs/tools/security/grype/default.nix b/pkgs/tools/security/grype/default.nix index a6ed2168670..1b80d7ecd88 100644 --- a/pkgs/tools/security/grype/default.nix +++ b/pkgs/tools/security/grype/default.nix @@ -6,23 +6,21 @@ buildGoModule rec { pname = "grype"; - version = "0.34.2"; + version = "0.34.3"; src = fetchFromGitHub { owner = "anchore"; repo = pname; rev = "v${version}"; - sha256 = "sha256-tMkMGM45/LcFllEgQ3UTl6FsLJmdsU8SLcLH/8+zMA4="; + sha256 = "sha256-iWmLfQ08+dhjvKQiK2iy2Tegk4jH9dGopu/6kdDRZd0="; # populate values that require us to use git. By doing this in postFetch we # can delete .git afterwards and maintain better reproducibility of the src. leaveDotGit = true; postFetch = '' cd "$out" - commit="$(git rev-parse HEAD)" - source_date_epoch=$(git log --date=format:'%Y-%m-%dT%H:%M:%SZ' -1 --pretty=%ad) - substituteInPlace "$out/internal/version/build.go" \ - --replace 'gitCommit = valueNotProvided' "gitCommit = \"$commit\"" \ - --replace 'buildDate = valueNotProvided' "buildDate = \"$source_date_epoch\"" + git rev-parse HEAD > $out/COMMIT + # 0000-00-00T00:00:00Z + date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH find "$out" -name .git -print0 | xargs -0 rm -rf ''; }; @@ -37,14 +35,17 @@ buildGoModule rec { "-s" "-w" "-X github.com/anchore/grype/internal/version.version=${version}" + "-X github.com/anchore/grype/internal/version.gitDescription=v${version}" "-X github.com/anchore/grype/internal/version.gitTreeState=clean" ]; preBuild = '' # grype version also displays the version of the syft library used # we need to grab it from the go.sum and add an ldflag for it - SYFTVERSION="$(grep "github.com/anchore/syft" go.sum -m 1 | awk '{print $2}')" - ldflags+=" -X github.com/anchore/grype/internal/version.syftVersion=$SYFTVERSION" + SYFT_VERSION="$(grep "github.com/anchore/syft" go.sum -m 1 | awk '{print $2}')" + ldflags+=" -X github.com/anchore/grype/internal/version.syftVersion=$SYFT_VERSION" + ldflags+=" -X github.com/anchore/grype/internal/version.gitCommit=$(cat COMMIT)" + ldflags+=" -X github.com/anchore/grype/internal/version.buildDate=$(cat SOURCE_DATE_EPOCH)" ''; # Tests require a running Docker instance |