forked from mirrors/nixpkgs
Merge pull request #265863 from SuperSandro2000/govulncheck-version
govulncheck: fix version information
This commit is contained in:
commit
9fd3c98dc3
|
@ -1,6 +1,7 @@
|
|||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
|
@ -14,6 +15,14 @@ buildGoModule rec {
|
|||
hash = "sha256-cewQ03dK/k3mXevE09M01Yox/3ZWP6IrG0H4QsZMzy8=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# patch in version information
|
||||
(substituteAll {
|
||||
src = ./version.patch;
|
||||
inherit version;
|
||||
})
|
||||
];
|
||||
|
||||
vendorHash = "sha256-r9XshbgVA5rppJF46SFYPad344ZHMLWTHTnL6vbIFH8=";
|
||||
|
||||
subPackages = [
|
||||
|
|
15
pkgs/tools/security/govulncheck/version.patch
Normal file
15
pkgs/tools/security/govulncheck/version.patch
Normal file
|
@ -0,0 +1,15 @@
|
|||
diff --git a/internal/scan/run.go b/internal/scan/run.go
|
||||
index fa7fe37..216ca43 100644
|
||||
--- a/internal/scan/run.go
|
||||
+++ b/internal/scan/run.go
|
||||
@@ -99,8 +99,8 @@ func scannerVersion(cfg *config, bi *debug.BuildInfo) {
|
||||
if bi.Path != "" {
|
||||
cfg.ScannerName = path.Base(bi.Path)
|
||||
}
|
||||
- if bi.Main.Version != "" && bi.Main.Version != "(devel)" {
|
||||
- cfg.ScannerVersion = bi.Main.Version
|
||||
+ if true {
|
||||
+ cfg.ScannerVersion = "@version@"
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in a new issue