Update dependency definition in conflicts (fixes #185)

The dependency specified when looking for conflicting packages
does not take into account the package version, as by default the
Relation field in the Dependency structure is set to VersionDontCare.
This should fix #185.
This commit is contained in:
Andrea Bernardo Ciddio
2015-01-30 16:22:27 +00:00
parent 8375a2c30f
commit 7a1553dc55
+1 -1
View File
@@ -140,7 +140,7 @@ func ImportPackageFiles(list *PackageList, packageFiles []string, forceReplace b
} }
if forceReplace { if forceReplace {
conflictingPackages := list.Search(Dependency{Pkg: p.Name, Version: p.Version, Architecture: p.Architecture}, true) conflictingPackages := list.Search(Dependency{Pkg: p.Name, Version: p.Version, Relation: VersionEqual, Architecture: p.Architecture}, true)
for _, cp := range conflictingPackages { for _, cp := range conflictingPackages {
reporter.Removed("%s removed due to conflict with package being added", cp) reporter.Removed("%s removed due to conflict with package being added", cp)
list.Remove(cp) list.Remove(cp)