Skip to content

Commit

Permalink
[reposync] Print also urls for repository metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Aug 9, 2019
1 parent ee6ce2c commit c03d986
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/reposync.py
Expand Up @@ -112,7 +112,16 @@ def run(self):
if self.opts.remote_time:
repo._repo.setPreserveRemoteTime(True)
if self.opts.download_metadata:
self.download_metadata(repo)
if self.opts.urls:
for md_type, md_location in repo._repo.getMetadataLocations():
url = repo.remote_location(md_location)
if url:
print(url)
else:
msg = _("Failed to get mirror for metadata: %s") % md_type
logger.warning(msg)
else:
self.download_metadata(repo)
if self.opts.downloadcomps:
self.getcomps(repo)
pkglist = self.get_pkglist(repo)
Expand Down Expand Up @@ -203,7 +212,7 @@ def download_packages(self, repo, pkglist):

def print_urls(self, pkglist):
for pkg in pkglist:
url = pkg.remote_location(schemes=['file', 'http', 'https', 'ftp'])
url = pkg.remote_location()
if url:
print(url)
else:
Expand Down

0 comments on commit c03d986

Please sign in to comment.