Skip to content

Commit

Permalink
Move version correction to gen_purl subroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 27, 2024
1 parent 537b21a commit 542b23b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions Build/IntrospectGolang.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ sub buildinfo {
my ($fh) = @_;
my ($vers, $mod) = rawbuildinfo($fh);
return undef unless defined $vers;
$vers =~ s/^go(.*)/$1/;

my $buildinfo = { 'goversion' => $vers };
my $lastmod;
for my $l (split("\n", $mod || '')) {
Expand Down
1 change: 1 addition & 0 deletions generate_sbom
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ sub gen_purl {
my ($p, $distro, $pkgtype) = @_;
my $name = $p->{'NAME'};
my $vr = $p->{'VERSION'};
$vr =~ s/^go// if $pkgtype eq 'golang' && $name eq 'stdlib';
my $purltype = $pkgtype eq 'rust' ? 'cargo' : $pkgtype;
my $subpath;
if ($pkgtype eq 'golang' && $name =~ /\A([^\/]+\/[^\/]+\/[^\/]+)\/(.+)/s) {
Expand Down

0 comments on commit 542b23b

Please sign in to comment.