Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make package version comparison use globbing. #2905

Merged
merged 1 commit into from
May 18, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions library/packaging/apt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ warnings.filterwarnings('ignore', "apt API not stable yet", FutureWarning)

import os
import datetime
import fnmatch

# APT related constants
APTITUDE_CMD = "aptitude"
Expand Down Expand Up @@ -143,10 +144,10 @@ def package_status(m, pkgname, version, cache, state):
return False, False
if version:
try :
return pkg.is_installed and pkg.installed.version == version, False
return pkg.is_installed and fnmatch.fnmatch(pkg.installed.version, version), False
except AttributeError:
#assume older version of python-apt is installed
return pkg.isInstalled and pkg.installedVersion == version, False
return pkg.isInstalled and fnmatch.fnmatch(pkg.installedVersion, version), False
else:
try :
return pkg.is_installed, pkg.is_upgradable
Expand Down