mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
archive: if using local file, avoid error trying to copy file to itself
This commit is contained in:
parent
f026b5d597
commit
63f614ebe3
@ -471,8 +471,11 @@ 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)
|
||||||
Logger.info("Copying %s from %s" % (filename, frompath))
|
if frompath == pathname:
|
||||||
shutil.copyfile(frompath, pathname)
|
Logger.info("Using %s" % pathname)
|
||||||
|
else:
|
||||||
|
Logger.info("Copying %s from %s" % (filename, frompath))
|
||||||
|
shutil.copyfile(frompath, pathname)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
with closing(urlopen(url)) as f:
|
with closing(urlopen(url)) as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user