From 1093c372eb3d8bad3510aa9b585b4f8d4b4bfe31 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Fri, 28 May 2021 16:17:08 -0400 Subject: [PATCH] archive: allow passing absolute path to _download_file --- ubuntutools/archive.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index 755c6ac..22291b7 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -375,8 +375,11 @@ class SourcePackage(ABC): return True def _download_file(self, url, filename, size=0, dscverify=False, sha1sum=None, sha256sum=None): - "Download url to filename in workdir." - pathname = os.path.join(self.workdir, filename) + "Download url to filename; will be put in workdir unless filename is absolute path." + if os.path.isabs(filename): + pathname = filename + else: + pathname = os.path.join(self.workdir, filename) if self._verify_file(pathname, dscverify, sha1sum, sha256sum, size): Logger.info('Using existing file %s', filename)