Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix up AddonVersion::Test() now that == behaves as it should, and add…

… some basic info as to what is expected in a doxy comment
  • Loading branch information...
commit c248a82e88b801bdaa9f18d97aedbdf073ec420a 1 parent 781b119
Jonathan Marshall authored
Showing with 14 additions and 5 deletions.
  1. +2 −5 xbmc/addons/AddonVersion.cpp
  2. +12 −0 xbmc/addons/AddonVersion.h
View
7 xbmc/addons/AddonVersion.cpp
@@ -163,11 +163,8 @@ namespace ADDON
ret &= (v1_0 != v1_0_0) && (v1_0 < v1_0_0) && (v1_0_0 > v1_0) &&
(v1_00 != v1_0_0) && (v1_00 < v1_0_0) && (v1_0_0 > v1_00);
- // These aren't totally sane
- // BEWARE: neither (v1_0 == v1_00) nor (v1_0 < v1_00) nor (v1_0 > v1_00) are true
- ret &= (v1_0 != v1_00) && !(v1_0 < v1_00) && !(v1_0 > v1_00);
- // BEWARE: neither (v1_1 == v1_01) nor (v1_1 < v1_01) nor (v1_1 > v1_01) are true
- ret &= (v1_1 != v1_01) && !(v1_1 < v1_01) && !(v1_1 > v1_01);
+ ret &= (v1_0 == v1_00) && !(v1_0 < v1_00) && !(v1_0 > v1_00);
+ ret &= (v1_1 == v1_01) && !(v1_1 < v1_01) && !(v1_1 > v1_01);
return ret;
}
View
12 xbmc/addons/AddonVersion.h
@@ -27,6 +27,18 @@
namespace ADDON
{
+ /* \brief Addon versioning using the debian versioning scheme
+
+ AddonVersion uses debian versioning, which means in the each section of the period
+ separated version string, numbers are compared numerically rather than lexicographically,
+ thus any preceding zeros are ignored.
+
+ i.e. 1.00 is considered the same as 1.0, and 1.01 is considered the same as 1.1.
+
+ Further, 1.0 < 1.0.0
+
+ See here for more info: http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
+ */
class AddonVersion : public boost::totally_ordered<AddonVersion> {
public:
AddonVersion(const AddonVersion& other) : mUpstream(NULL), mRevision(NULL) { *this = other; }
Please sign in to comment.
Something went wrong with that request. Please try again.