archive: if using local file, avoid error trying to copy file to itself

This commit is contained in:
Dan Streetman 2020-01-21 13:31:10 -05:00
parent f026b5d597
commit 63f614ebe3

View File

@ -471,6 +471,9 @@ class SourcePackage(object):
if urlparse(url).scheme in ["", "file"]: if urlparse(url).scheme in ["", "file"]:
frompath = os.path.abspath(urlparse(url).path) frompath = os.path.abspath(urlparse(url).path)
if frompath == pathname:
Logger.info("Using %s" % pathname)
else:
Logger.info("Copying %s from %s" % (filename, frompath)) Logger.info("Copying %s from %s" % (filename, frompath))
shutil.copyfile(frompath, pathname) shutil.copyfile(frompath, pathname)
else: else: