summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2012-05-23 19:48:04 +0800
committerGui Chen <gui.chen@intel.com>2012-05-23 19:48:04 +0800
commit3e377a22b558dd1be9c33cd1c2904bf99e164e2b (patch)
tree75ec4c7f76b60f9b7abd11117e0267c4fda31d02 /plugins
parent4d567d5a6f4092850dadeabbd8527986af42b7ec (diff)
downloadmic-3e377a22b558dd1be9c33cd1c2904bf99e164e2b.tar.gz
mic-3e377a22b558dd1be9c33cd1c2904bf99e164e2b.tar.bz2
mic-3e377a22b558dd1be9c33cd1c2904bf99e164e2b.zip
fix zypp missing password when using username:passwd pattern url
if repo url is like 'http://username:passwd@host/repo/', zypp would handle incorrectly, and this commit fix the issue Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/backend/zypppkgmgr.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/backend/zypppkgmgr.py b/plugins/backend/zypppkgmgr.py
index 8466dc1..b34596f 100755
--- a/plugins/backend/zypppkgmgr.py
+++ b/plugins/backend/zypppkgmgr.py
@@ -330,7 +330,6 @@ class Zypp(BackendPlugin):
repo.gpgcheck = 1
if priority:
repo.priority = priority
- self.repos.append(repo)
try:
repo_info = zypp.RepoInfo()
@@ -359,6 +358,9 @@ class Zypp(BackendPlugin):
baseurl.setQueryParam ("proxy", host)
baseurl.setQueryParam ("proxyport", port)
+ repo.baseurl[0] = baseurl.asCompleteString()
+ self.repos.append(repo)
+
repo_info.addBaseUrl(baseurl)
if repo.priority:
@@ -631,7 +633,9 @@ class Zypp(BackendPlugin):
if not os.path.exists(dirn):
os.makedirs(dirn)
- baseurl = str(po.repoInfo().baseUrls()[0])
+ name = str(po.repoInfo().name())
+ repo = filter(lambda r: r.name == name, self.repos)[0]
+ baseurl = repo.baseurl[0]
index = baseurl.find("?")
if index > -1:
baseurl = baseurl[:index]