From 3e377a22b558dd1be9c33cd1c2904bf99e164e2b Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Wed, 23 May 2012 19:48:04 +0800 Subject: 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 --- plugins/backend/zypppkgmgr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') 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] -- cgit v1.2.3