Commit bd2ffef6 authored by Seth Vidal's avatar Seth Vidal

check in patch from Mark McLoughlin to fix handling of local repos in

reposync, repotrack and yumdownloader.
parent 3a96cac5
......@@ -34,6 +34,7 @@
import os
import sys
import shutil
from optparse import OptionParser
from urlparse import urljoin
......@@ -186,9 +187,10 @@ def main():
if not opts.quiet:
my.logger.info( 'Downloading %s' % os.path.basename(remote))
pkg.localpath = local # Hack: to set the localpath we want.
repo.getPackage(pkg)
path = repo.getPackage(pkg)
if not os.path.exists(local) or not os.path.samefile(path, local):
shutil.copy2(path, local)
if __name__ == "__main__":
main()
......
......@@ -23,6 +23,7 @@
import os
import sys
import shutil
from optparse import OptionParser
from urlparse import urljoin
import logging
......@@ -235,8 +236,10 @@ def main():
if not opts.quiet:
my.logger.info('Downloading %s' % os.path.basename(remote))
pkg.localpath = local # Hack: to set the localpath to what we want.
repo.getPackage(pkg)
path = repo.getPackage(pkg)
if not os.path.exists(local) or not os.path.samefile(path, local):
shutil.copy2(path, local)
if __name__ == "__main__":
main()
......
......@@ -21,6 +21,7 @@ sys.path.insert(0, '/usr/share/yum-cli')
import yum
import yum.Errors
import os
import shutil
import output
import rpmUtils.arch
from urlgrabber.progress import TextMeter
......@@ -174,7 +175,14 @@ def main():
# Disable cache otherwise things won't download
repo.cache = 0
download.localpath = local # Hack: to set the localpath we want.
repo.getPackage(download)
path = repo.getPackage(download)
if not os.path.exists(local) or not os.path.samefile(path, local):
progress = TextMeter()
progress.start(basename=os.path.basename(local),
size=os.stat(path).st_size)
shutil.copy2(path, local)
progress.end(progress.size)
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment