if result != 0:
rejected = True
self.reject("%s: 'ar t' invocation failed." % (self.filename))
- self.reject(utils.prefix_multi_line_string(output, " [ar output:] "), "")
+ self.reject(utils.prefix_multi_line_string(output, " [ar output:] "))
self.chunks = output.split('\n')
# a temporary directory
if not self.tmpdir:
- tmpdir = tempfile.mkdtemp()
+ tmpdir = utils.temp_dirname()
cwd = os.getcwd()
try:
os.chdir( tmpdir )
if self.chunks[0] != "debian-binary":
rejected = True
self.reject("%s: first chunk is '%s', expected 'debian-binary'." % (self.filename, self.chunks[0]))
- if self.chunks[1] != "control.tar.gz":
+ if not rejected and self.chunks[1] != "control.tar.gz":
rejected = True
self.reject("%s: second chunk is '%s', expected 'control.tar.gz'." % (self.filename, self.chunks[1]))
- if self.chunks[2] not in [ "data.tar.bz2", "data.tar.gz" ]:
+ if not rejected and self.chunks[2] not in [ "data.tar.bz2", "data.tar.gz" ]:
rejected = True
self.reject("%s: third chunk is '%s', expected 'data.tar.gz' or 'data.tar.bz2'." % (self.filename, self.chunks[2]))
if bootstrap_id:
result = DBConn().insert_content_paths(bootstrap_id, [tarinfo.name for tarinfo in data if not tarinfo.isdir()])
else:
- pkg = deb822.Packages.iter_paragraphs(file(os.path.join(self.tmpdir,'control'))).next()
+ pkgs = deb822.Packages.iter_paragraphs(file(os.path.join(self.tmpdir,'control')))
+ pkg = pkgs.next()
result = DBConn().insert_pending_content_paths(pkg, [tarinfo.name for tarinfo in data if not tarinfo.isdir()])
except: