From e14c48ff616ba8f79ed032bc82cc4ecde9dfa301 Mon Sep 17 00:00:00 2001 From: Jacob Kozol Date: Wed, 25 Sep 2019 15:37:00 +0200 Subject: [PATCH] Fix package name-version for wildcard version If a package had version "*" and its name-version would be "name-*". This would match all packages containing "name" in their name. Instead the name-version is "name-*-*" so it matches any version of the package. --- internal/weldr/api.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/weldr/api.go b/internal/weldr/api.go index eea49eac4..acb1e9f6c 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -443,11 +443,14 @@ func (api *API) blueprintsDepsolveHandler(writer http.ResponseWriter, request *h specs := make([]string, len(blueprint.Packages)) for i, pkg := range blueprint.Packages { specs[i] = pkg.Name - if pkg.Version != "" { + // If a package has version "*" the package name suffix must be equal to "-*-*.*" + // Using just "-*" would find any other package containing the package name + if pkg.Version != "" && pkg.Version != "*" { specs[i] += "-" + pkg.Version + } else if pkg.Version == "*" { + specs[i] += "-*-*.*" } } - dependencies, _ := rpmmd.Depsolve(specs...) blueprints = append(blueprints, entry{blueprint, dependencies})