use urlgrab instead of urlopen in download-build
This commit is contained in:
parent
d60e8e563f
commit
88e7d0c1e1
1 changed files with 1 additions and 12 deletions
13
cli/koji
13
cli/koji
|
|
@ -6308,20 +6308,9 @@ def anon_handle_download_build(options, session, args):
|
|||
pg = progress.TextMeter()
|
||||
|
||||
for url, relpath in urls:
|
||||
file = grabber.urlopen(url, progress_obj=pg, text=relpath)
|
||||
|
||||
if '/' in relpath:
|
||||
koji.ensuredir(os.path.dirname(relpath))
|
||||
out = os.open(relpath, os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0666)
|
||||
try:
|
||||
while 1:
|
||||
buf = file.read(4096)
|
||||
if not buf:
|
||||
break
|
||||
os.write(out, buf)
|
||||
finally:
|
||||
os.close(out)
|
||||
file.close()
|
||||
grabber.urlgrab(url, filename=relpath, progress_obj=pg, text=relpath)
|
||||
|
||||
|
||||
def anon_handle_download_logs(options, session, args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue