From 31fecc3ec27dd568932991360a7547fd15272ca8 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Thu, 29 Mar 2018 14:40:38 +0100 Subject: [PATCH] Don't check versioning for devel packages Devel packages can't be trusted to sho their real provides. Pretend that that the provide applies to all versions. In the rare case where the dependency is unsatisfied pacman will refuse to install so no harm can be caused. --- dependencies.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/dependencies.go b/dependencies.go index 5edd406a..b17b5d1e 100644 --- a/dependencies.go +++ b/dependencies.go @@ -70,6 +70,16 @@ func splitDbFromName(pkg string) (string, string) { return "", split[0] } +func isDevelName(name string) bool { + for _, suffix := range []string{"git", "svn", "hg", "bzr", "nightly"} { + if strings.HasSuffix(name, suffix) { + return true + } + } + + return strings.Contains(name, "-always-") +} + func getBases(pkgs map[string]*rpc.Pkg) map[string][]*rpc.Pkg { bases := make(map[string][]*rpc.Pkg) @@ -489,12 +499,14 @@ func checkVersions(dt *depTree) error { addMapStringSlice(has, pkg.Name, pkg.Version) - for _, name := range pkg.Provides { - _name, _ver := splitNameFromDep(name) - if _ver != "" { - addMapStringSlice(has, _name, _ver) - } else { - delete(has, _name) + if !isDevelName(pkg.Name) { + for _, name := range pkg.Provides { + _name, _ver := splitNameFromDep(name) + if _ver != "" { + addMapStringSlice(has, _name, _ver) + } else { + delete(has, _name) + } } } }