Skip to content
Permalink
Browse files

reposync: refactor: sanitize remote_path usage

For better readability (remote_path == relativepath).
  • Loading branch information...
dmnks committed Jul 19, 2018
1 parent 1814b65 commit 7554c0133eb830a71dc01846037cc047d0acbc2c
Showing with 5 additions and 9 deletions.
  1. +5 −9 reposync.py
@@ -221,8 +221,7 @@ def main():

download_set = {}
for pkg in download_list:
remote = pkg.returnSimple('relativepath')
rpmname = os.path.basename(remote)
rpmname = os.path.basename(pkg.remote_path)
download_set[rpmname] = 1

for pkg in current_pkgs:
@@ -269,8 +268,7 @@ def main():
remote_size = 0
if not opts.urls:
for pkg in download_list:
remote = pkg.returnSimple('relativepath')
local = local_repo_path + '/' + remote
local = os.path.join(local_repo_path, pkg.remote_path)
sz = int(pkg.returnSimple('packagesize'))
if os.path.exists(local) and os.path.getsize(local) == sz:
continue
@@ -282,10 +280,9 @@ def main():
download_list.sort(key=lambda pkg: pkg.name)
if opts.urls:
for pkg in download_list:
remote = pkg.returnSimple('relativepath')
local = os.path.join(local_repo_path, remote)
local = os.path.join(local_repo_path, pkg.remote_path)
if not (os.path.exists(local) and my.verifyPkg(local, pkg, False)):
print urljoin(pkg.repo.urls[0], pkg.relativepath)
print urljoin(pkg.repo.urls[0], pkg.remote_path)
continue

# create dest dir
@@ -294,8 +291,7 @@ def main():

# set localpaths
for pkg in download_list:
rpmfn = pkg.remote_path
pkg.localpath = os.path.join(local_repo_path, rpmfn)
pkg.localpath = os.path.join(local_repo_path, pkg.remote_path)
pkg.repo.copy_local = True
pkg.repo.cache = 0
localdir = os.path.dirname(pkg.localpath)

0 comments on commit 7554c01

Please sign in to comment.
You can’t perform that action at this time.