Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lpato:sll7
yum
0999-add-credential-handling-for-repo-urls.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0999-add-credential-handling-for-repo-urls.patch of Package yum
diff --git a/yum/yumRepo.py b/yum/yumRepo.py --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -332,6 +332,7 @@ class YumRepository(Repository, config.R self.repofile = None self.mirrorurls = [] self._urls = [] + self._append_creds = "" self.enablegroups = 0 self.groupsfilename = 'yumgroups.xml' # something some freaks might # eventually want @@ -636,6 +637,15 @@ class YumRepository(Repository, config.R if self.metalink: urls = map(add_mc, urls) + def get_creds_from_url(url): + if url.startswith("http") and '?' in url: + self._append_creds = url[url.find('?'):] + return url[:url.find('?')] + else: + return url + + urls = map(get_creds_from_url, urls) + def mirror_failure(obj): action = {} @@ -1008,7 +1018,7 @@ Insufficient space in download directory remote = url + '/' + relative try: - result = ug.urlgrab(misc.to_utf8(remote), local, + result = ug.urlgrab(misc.to_utf8(remote + self._append_creds), local, text=misc.to_utf8(text), range=(start, end), ) @@ -1022,7 +1032,7 @@ Insufficient space in download directory else: headers = tuple(self.__headersListFromDict(cache=cache)) try: - result = self.grab.urlgrab(misc.to_utf8(relative), local, + result = self.grab.urlgrab(misc.to_utf8(relative + self._append_creds), local, text = misc.to_utf8(text), range = (start, end), copy_local=copy_local,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor