mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 15:36:41 +01:00
fix(golang): improve version extraction from ldflags for pingcap TiDB (#2962)
* fix(golang): improve version extraction from ldflags for pingcap TiDB Signed-off-by: Weston Steimel <commits@weston.slmail.me> * loosen ld flag parsing requirements Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Weston Steimel <commits@weston.slmail.me> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
273e31e806
commit
749ccc59c1
@@ -38,8 +38,8 @@ var (
|
||||
// inject the correct version into the main module of the build process
|
||||
|
||||
knownBuildFlagPatterns = []*regexp.Regexp{
|
||||
regexp.MustCompile(`(?m)\.([gG]it)?([bB]uild)?[vV]er(sion)?=(\S+/)*(?P<version>v?\d+.\d+.\d+[-\w]*)`),
|
||||
regexp.MustCompile(`(?m)\.([tT]ag)=(\S+/)*(?P<version>v?\d+.\d+.\d+[-\w]*)`),
|
||||
regexp.MustCompile(`(?m)\.[a-zA-Z0-9]*([rR]elease)?([gG]it)?([bB]uild)?[vV]er(sion)?=(\S+/)*(?P<version>v?\d+.\d+.\d+[-\w]*)`),
|
||||
regexp.MustCompile(`(?m)\.[a-zA-Z0-9]*([tT]ag)=(\S+/)*(?P<version>v?\d+.\d+.\d+[-\w]*)`),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user