Skip to content

Commit

Permalink
[reposync] Print urls also for repository metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Sep 10, 2019
1 parent 9392433 commit 8eb0e0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dnf-plugins-core.spec
@@ -1,6 +1,6 @@
%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 4.2.10}
%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 4.2.12}
%global dnf_plugins_extra 2.0.0
%global hawkey_version 0.34.0
%global hawkey_version 0.35.6
%global yum_utils_subpackage_name dnf-utils
%if 0%{?rhel} > 7
%global yum_utils_subpackage_name yum-utils
Expand Down
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 8eb0e0d

Please sign in to comment.