Merge pull request #469 from nafeger/devel
Add support for older version of python-apt
This commit is contained in:
commit
4d74c770db
1 changed files with 10 additions and 2 deletions
|
@ -74,9 +74,17 @@ def package_status(pkgname, version, cache):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
fail_json(msg="No package matching '%s' is available" % pkgname)
|
fail_json(msg="No package matching '%s' is available" % pkgname)
|
||||||
if version:
|
if version:
|
||||||
|
try :
|
||||||
return pkg.is_installed and pkg.installed.version == version, False
|
return pkg.is_installed and pkg.installed.version == version, False
|
||||||
|
except AttributeError:
|
||||||
|
#assume older version of python-apt is installed
|
||||||
|
return pkg.isInstalled and pkg.installedVersion == version, False
|
||||||
else:
|
else:
|
||||||
|
try :
|
||||||
return pkg.is_installed, pkg.is_upgradable
|
return pkg.is_installed, pkg.is_upgradable
|
||||||
|
except AttributeError:
|
||||||
|
#assume older version of python-apt is installed
|
||||||
|
return pkg.isInstalled, pkg.isUpgradable
|
||||||
|
|
||||||
def install(pkgspec, cache, upgrade=False, default_release=None):
|
def install(pkgspec, cache, upgrade=False, default_release=None):
|
||||||
name, version = package_split(pkgspec)
|
name, version = package_split(pkgspec)
|
||||||
|
|
Loading…
Reference in a new issue