@@ -23,7 +23,6 @@ import (
2323 "io"
2424 "io/fs"
2525 "path/filepath"
26- "regexp"
2726 "slices"
2827 "strings"
2928 "unicode"
@@ -379,8 +378,6 @@ func generateSharedObjectNameDeps(ctx context.Context, hdl SCAHandle, generated
379378 return nil
380379}
381380
382- var pkgConfigVersionRegexp = regexp .MustCompile ("-(alpha|beta|rc|pre)" )
383-
384381// TODO(kaniini): Turn this feature on once enough of Wolfi is built with provider data.
385382var generateRuntimePkgConfigDeps = false
386383
@@ -439,18 +436,12 @@ func generatePkgConfigDeps(ctx context.Context, hdl SCAHandle, generated *config
439436 pcName := filepath .Base (path )
440437 pcName , _ = strings .CutSuffix (pcName , ".pc" )
441438
442- // TODO: https://github.com/chainguard-dev/melange/issues/1172
443- sigh := func (ver string ) string {
444- return strings .TrimSuffix (ver , "-release" )
445- }
446-
447- apkVersion := pkgConfigVersionRegexp .ReplaceAllString (pkg .Version , "_$1" )
448439 if isInDir (path , []string {"lib/pkgconfig/" , "usr/lib/pkgconfig/" , "lib64/pkgconfig/" , "usr/lib64/pkgconfig/" }) {
449440 log .Infof (" found pkg-config %s for %s" , pcName , path )
450- generated .Provides = append (generated .Provides , fmt .Sprintf ("pc:%s=%s" , pcName , sigh ( apkVersion )))
441+ generated .Provides = append (generated .Provides , fmt .Sprintf ("pc:%s=%s" , pcName , hdl . Version ( )))
451442 } else {
452443 log .Infof (" found vendored pkg-config %s for %s" , pcName , path )
453- generated .Vendored = append (generated .Vendored , fmt .Sprintf ("pc:%s=%s" , pcName , sigh ( apkVersion )))
444+ generated .Vendored = append (generated .Vendored , fmt .Sprintf ("pc:%s=%s" , pcName , hdl . Version ( )))
454445 }
455446
456447 if generateRuntimePkgConfigDeps {
0 commit comments