Checks if our version and the version number recorded in a file
are consistent.
"""
+ real = self.detectVersion()
+ if not str(real) == self.app_version.pristine_tag.partition('-')[2]:
+ raise VersionMismatchError(real, self.version)
+
+ @property
+ @chdir_to_location
+ def detectVersion(self):
+ """
+ Returns the real version, based on filesystem, of install.
+
+ Throws a :class:`VersionDetectionError` if we couldn't figure out
+ what the real version was.
+ """
real = self.application.detectVersion(self)
if not real:
raise VersionDetectionError
- elif not str(real) == self.app_version.pristine_tag.partition('-')[2]:
- raise VersionMismatchError(real, self.version)
+ return real
@property
@chdir_to_location