+ cmd = ('dpkg-source', '--no-check', '--no-copy', '-x', dsc_filename, tempdir)
+ try:
+ daklib.daksubprocess.check_output(cmd, stderr=1)
+ except subprocess.CalledProcessError as e:
+ res = "How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some\n old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?\n"
+ res += "Error, couldn't extract source, WTF?\n"
+ res += "'dpkg-source -x' failed. return code: %s.\n\n" % (e.returncode)
+ res += e.output
+ return res
+
+ path = os.path.join(tempdir, 'debian/README.source')
+ res = ""
+ if os.path.exists(path):
+ res += do_command(["cat", "--", path])
+ else:
+ res += "No README.source in this package\n\n"
+
+ try:
+ shutil.rmtree(tempdir)
+ except OSError as e:
+ if errno.errorcode[e.errno] != 'EACCES':
+ res += "%s: couldn't remove tmp dir %s for source tree." % (dsc_filename, tempdir)
+
+ return res
+
+def check_dsc (suite, dsc_filename, session = None):
+ dsc = read_changes_or_dsc(suite, dsc_filename, session)
+ dsc_basename = os.path.basename(dsc_filename)
+ return foldable_output(dsc_filename, "dsc", dsc, norow=True) + \
+ "\n" + \
+ foldable_output("lintian check for %s" % dsc_basename,
+ "source-lintian", do_lintian(dsc_filename)) + \
+ "\n" + \
+ foldable_output("README.source for %s" % dsc_basename,
+ "source-readmesource", get_readme_source(dsc_filename))
+
+def check_deb (suite, deb_filename, session = None):