Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
b9cb49e6
Commit
b9cb49e6
authored
Dec 13, 2013
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4872 from timurbatyrshin/4869-old-python-apt-fix
#4869 compatibility with older versions of apt
parents
301a1189
9e7623e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
library/packaging/apt
+19
-10
No files found.
library/packaging/apt
View file @
b9cb49e6
...
...
@@ -181,20 +181,29 @@ def package_status(m, pkgname, version, cache, state):
except AttributeError:
has_files = False # older python-apt cannot be used to determine non-purged
try:
package_is_installed = ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED
except AttributeError: # python-apt 0.7.X has very weak low-level object
try:
# might not be necessary as python-apt post-0.7.X should have current_state property
package_is_installed = pkg.is_installed
except AttributeError:
# assume older version of python-apt is installed
package_is_installed = pkg.isInstalled
if version:
try :
return ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED and \
fnmatch.fnmatch(pkg.installed.version, version), False, has_files
try:
installed_version = pkg.installed.version
except AttributeError:
#assume older version of python-apt is installed
return ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED and \
fnmatch.fnmatch(pkg.installedVersion, version), False, has_files
installed_version = pkg.installedVersion
return package_is_installed and fnmatch.fnmatch(installed_version, version), False, has_files
else:
try
:
return ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED, pkg.is_upgradable, has_files
try:
package_is_upgradable = pkg.is_upgradable
except AttributeError:
#assume older version of python-apt is installed
return ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED, pkg.isUpgradable, has_files
# assume older version of python-apt is installed
package_is_upgradable = pkg.isUpgradable
return package_is_installed, package_is_upgradable, has_files
def expand_dpkg_options(dpkg_options_compressed):
options_list = dpkg_options_compressed.split('
,
')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment