Skip to content

Commit

Permalink
[reposync] Enable --urls together with --downloadcomps
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha authored and pkratoch committed Nov 8, 2019
1 parent 1f716be commit 0decd92
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plugins/reposync.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,22 @@ def run(self):
else:
self.download_metadata(repo)
if self.opts.downloadcomps:
self.getcomps(repo)
if self.opts.urls:
mdl = dict(repo._repo.getMetadataLocations())
group_locations = [mdl[md_type]
for md_type in ('group', 'group_gz', 'group_gz_zck')
if md_type in mdl]
if group_locations:
for group_location in group_locations:
url = repo.remote_location(group_location)
if url:
print(url)
break
else:
msg = _("Failed to get mirror for the group file.")
logger.warning(msg)
else:
self.getcomps(repo)
pkglist = self.get_pkglist(repo)
if self.opts.urls:
self.print_urls(pkglist)
Expand Down

0 comments on commit 0decd92

Please sign in to comment.