Fix for dependency resolution - take into account release number
This commit is contained in:
parent
94eb94952f
commit
efb28a30e2
@ -60,7 +60,10 @@ impl Database {
|
||||
// Check if we've already pulled in an update from another repo,
|
||||
// and if so compare versions
|
||||
if let Some(other_update) = updates.get(&name) {
|
||||
if remote_package.version > other_update.version {
|
||||
if remote_package.version > other_update.version
|
||||
|| (remote_package.version == other_update.version
|
||||
&& remote_package.release > other_update.release)
|
||||
{
|
||||
// The remote version is an update to the already
|
||||
// pulled in update, so swap it out
|
||||
let update = Update {
|
||||
|
@ -122,7 +122,9 @@ impl Package {
|
||||
|
||||
/// Tests whether this package is an update for another
|
||||
pub fn is_upgrade(&self, other: &Self) -> bool {
|
||||
self.name == other.name && self.version > other.version
|
||||
self.name == other.name
|
||||
&& (self.version > other.version
|
||||
|| (self.version == other.version && self.release > other.release))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,10 +137,21 @@ impl PartialOrd for Version {
|
||||
},
|
||||
) => b.partial_cmp(&d),
|
||||
(
|
||||
Self::SemVer { major, minor, patch },
|
||||
Self::SemVer {
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
},
|
||||
Self::Rapid { major: a, minor: b },
|
||||
) => SemVer { major: *major, minor: *minor, patch: *patch }
|
||||
.partial_cmp(&Rapid { major: *a, minor: *b }),
|
||||
) => SemVer {
|
||||
major: *major,
|
||||
minor: *minor,
|
||||
patch: *patch,
|
||||
}
|
||||
.partial_cmp(&Rapid {
|
||||
major: *a,
|
||||
minor: *b,
|
||||
}),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user