summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2013-04-02 13:58:06 +0800
committerGui Chen <gui.chen@intel.com>2013-04-02 15:54:42 +0800
commit3e0de1d603ef48b48b845f8a83885dbd91f1fc76 (patch)
tree90f2aaa17d842bd90a5a9d30d133df8b5c198dc6 /plugins
parent4cc9b1be3146a70485977b1dde0677b3d4b7530d (diff)
downloadmic-3e0de1d603ef48b48b845f8a83885dbd91f1fc76.tar.gz
mic-3e0de1d603ef48b48b845f8a83885dbd91f1fc76.tar.bz2
mic-3e0de1d603ef48b48b845f8a83885dbd91f1fc76.zip
fix conflict variable in cmpEVR and priority condition
Change-Id: Icd9b2eeac10e5f8265445d96cc9ceb1a5116d158 Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/backend/zypppkgmgr.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/backend/zypppkgmgr.py b/plugins/backend/zypppkgmgr.py
index 7272805..facecf3 100755
--- a/plugins/backend/zypppkgmgr.py
+++ b/plugins/backend/zypppkgmgr.py
@@ -181,11 +181,11 @@ class Zypp(BackendPlugin):
return 1
# Priority of a repository is an integer value between 0 (the
# highest priority) and 99 (the lowest priority)
- p1 = int(p1.repoInfo().priority())
- p2 = int(p2.repoInfo().priority())
- if p1 > p2:
+ pr1 = int(p1.repoInfo().priority())
+ pr2 = int(p2.repoInfo().priority())
+ if pr1 > pr2:
return -1
- elif p1 < p2:
+ elif pr1 < pr2:
return 1
ed1 = p1.edition()
@@ -371,8 +371,9 @@ class Zypp(BackendPlugin):
# Enable gpg check for verifying corrupt packages
repo.gpgcheck = 1
- if priority:
- repo.priority = priority
+ if priority is not None:
+ # priority 0 has issue in RepoInfo.setPriority
+ repo.priority = priority + 1
try:
repo_info = zypp.RepoInfo()
@@ -406,7 +407,7 @@ class Zypp(BackendPlugin):
repo_info.addBaseUrl(baseurl)
- if repo.priority:
+ if repo.priority is not None:
repo_info.setPriority(repo.priority)
# this hack is used to change zypp credential file location