2018-08-15 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rddbmgr(8) that caused unreliable calculation of
	the correct schema version from a package version string.
This commit is contained in:
Fred Gleason
2018-08-15 23:03:28 +00:00
parent e6ea8a59d0
commit f0f5730e76
3 changed files with 13 additions and 5 deletions

View File

@@ -32,6 +32,7 @@ class VersionString : public QString
int minor() const;
int point() const;
bool operator<(const VersionString &rhs) const;
bool operator==(const VersionString &rhs) const;
private:
int ver_major;
@@ -95,13 +96,16 @@ bool VersionString::operator<(const VersionString &rhs) const
if(minor()>rhs.minor()) {
return false;
}
if(point()<rhs.point()) {
return true;
}
return false;
}
bool VersionString::operator==(const VersionString &rhs) const
{
return (major()==rhs.major())&&(minor()==rhs.minor());
}
//
// Version -> Schema Map
//
@@ -169,7 +173,7 @@ int MainObject::GetVersionSchema(const QString &ver) const
return 0;
}
return global_version_map[VersionString(f0[0]+"."+f0[1])];
return global_version_map.value(VersionString(f0[0]+"."+f0[1]));
}