def download_source_patch(self, target, logger=None): self.slog(logger, '# Downloading patch:', self.source) fname = retrieve(self.source) patch_name = os.path.basename(self.source) patch_path = os.path.join(target, patch_name) shutil.move(fname, patch_path) return patch_path
def download_orig(self, target, logger=None): self.slog(logger, '# Downloading', self.orig) fname = retrieve(self.orig) orig_name = os.path.basename(self.orig) orig_path = os.path.join(target, orig_name) shutil.move(fname, orig_path) return orig_path
def download_extra_orig(self, target, logger=None): items = [] for url in self.extra_orig: self.slog(logger, '# Downloading', url) fname = retrieve(url) orig_name = os.path.basename(url) orig_path = os.path.join(target, orig_name) shutil.move(fname, orig_path) items.append(orig_path) return items
def download_source_tarball(self, target, logger=None): try: tmp = tempfile.mkdtemp('-irgsh-tarball') self.slog(logger, '# Downloading tarball:', self.source) tmpname = retrieve(self.source) source_name = os.path.basename(self.source) source_path = os.path.join(tmp, source_name) shutil.move(tmpname, source_path) extract_tarball(source_path, target) return target except tarfile.ReadError, e: raise StandardError(e)