def clean_orig(self): with pwd(self.pkg_src_dir): sourceball = tarfile.open(self.sourceball) with pwd(self.branches_dir): rm(self.orig_dir(self.name)) sourceball.extractall() move(self.name, self.orig_dir(self.name))
def prepare_sourceballs(self, install=False, force=False, *args): tmp_dir = mkdtemp() pkg_srcen = self.pkg.sources pkg_srcen = (DirFactory(pkg_src) for pkg_src in pkg_srcen) with self.pkg.in_dir(): for pkg_src in pkg_srcen: with pwd(tmp_dir): sourceball = SourceBall(pkg_src.full_name, pkg_src.sourceball_loc) builder = self.builder(sourceball) builder.prepare(install, force, *args) rm(sourceball.pkg_src_dir) tar_file = tarfile.open(pkg_src.sourceball_loc, 'w:gz') tar_file.add(pkg_src.full_name) tar_file.close() rm(tmp_dir)
def setup_sourceball(self, ver, delete_old=False): '''gets darcs to spit out a sourceball to be used in rpm making by other modules''' log.debug('someone set us up the bomb') if delete_old: with pwd(self.pkg_src_dir): rm(self.sourceball) name = self.upstream_name date = self.date full_name = '%s-%s.%sdarcs' % (name, ver, date) log.debug('full name is ' + full_name) sourceball = full_name + '.tar.gz' with pwd(self.source_dir): with log_file('darcs.log') as darcs_out: log.debug('we get signal') p = Popen(['darcs', 'dist', '-d', full_name], stdout=darcs_out, stderr=darcs_out) log.info('generating tarball %s.tar.gz, please wait...' % full_name) p.communicate() with pwd(self.pkg_src_dir): move(join(self.source_dir, sourceball), sourceball) self.cfg['sourceball'] = sourceball
def setup_sourceball(self, ver, delete_old=False): '''gets darcs to spit out a sourceball to be used in rpm making by other modules''' log.debug('someone set us up the bomb') if delete_old: with pwd(self.pkg_src_dir): rm(self.sourceball) name = self.upstream_name date = self.date full_name = '%s-%s.%s' % (name, ver, self.alphatag) log.debug('full name is ' + full_name) sourceball = full_name + '.tar.gz' with pwd(self.source_dir): with log_file('git.log') as git_out: p1 = Popen(['git', 'archive', '--format=tar', "--prefix=%s/" % full_name, "HEAD"], stdout=PIPE, stderr=git_out) log.info('generating tarball %s.tar.gz, please wait...' % full_name) with pwd(self.pkg_src_dir): with file(sourceball, "wb") as sourceball_file: p2 = Popen(['gzip'], stdin=p1.stdout, stdout=sourceball_file, stderr=git_out) p2.communicate() self.cfg['sourceball'] = sourceball self.cfg['full_name'] = full_name
def del_source(self, source): self.rem_source(source) with pwd(self.dir): rm(source)