X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=ff1c51d12fd45920d9303d8c3a0254343355381a;hb=b44e01da2c36417b28f88df73318d8a1be2196b1;hp=1d2a3275fc43ac8f29d062affa974a3f3efc6d6f;hpb=05c002afb12f077d753234de45753062fa54ce02;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index 1d2a3275..ff1c51d1 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -1025,21 +1025,16 @@ class Upload(object): ########################################################################### - def get_changelog_versions(self, source_dir): - """Extracts a the source package and (optionally) grabs the - version history out of debian/changelog for the BTS.""" - - cnf = Config() + def ensure_all_source_exists(self, dest_dir=None): + """ + Ensure that dest_dir contains all the orig tarballs for the specified + changes. If it does not, symlink them into place. - # Find the .dsc (again) - dsc_filename = None - for f in self.pkg.files.keys(): - if self.pkg.files[f]["type"] == "dsc": - dsc_filename = f + If dest_dir is None, populate the current directory. + """ - # If there isn't one, we have nothing to do. (We have reject()ed the upload already) - if not dsc_filename: - return + if dest_dir is None: + dest_dir = os.getcwd() # Create a symlink mirror of the source files in our temporary directory for f in self.pkg.files.keys(): @@ -1064,6 +1059,26 @@ class Upload(object): dest = os.path.join(os.getcwd(), os.path.basename(orig_file)) os.symlink(self.pkg.orig_files[orig_file]["path"], dest) + ########################################################################### + + def get_changelog_versions(self, source_dir): + """Extracts a the source package and (optionally) grabs the + version history out of debian/changelog for the BTS.""" + + cnf = Config() + + # Find the .dsc (again) + dsc_filename = None + for f in self.pkg.files.keys(): + if self.pkg.files[f]["type"] == "dsc": + dsc_filename = f + + # If there isn't one, we have nothing to do. (We have reject()ed the upload already) + if not dsc_filename: + return + + self.ensure_all_source_exists() + # Extract the source cmd = "dpkg-source -sn -x %s" % (dsc_filename) (result, output) = commands.getstatusoutput(cmd) @@ -1207,6 +1222,8 @@ class Upload(object): if not valid_dist: return + self.ensure_all_source_exists() + cnf = Config() tagfile = cnf.get("Dinstall::LintianTags") if tagfile is None: @@ -1250,6 +1267,10 @@ class Upload(object): if len(output) == 0: return + def log(*txt): + if self.logger: + self.logger.log([self.pkg.changes_file, "check_lintian", *txt]) + # We have output of lintian, this package isn't clean. Lets parse it and see if we # are having a victim for a reject. # W: tzdata: binary-without-manpage usr/sbin/tzconfig @@ -1276,9 +1297,11 @@ class Upload(object): elif etag in lintiantags['error']: # The tag is overriden - but is not allowed to be self.rejects.append("%s: Overriden tag %s found, but this tag may not be overwritten." % (epackage, etag)) + log("overidden tag is overridden", etag) else: # Tag is known, it is not overriden, direct reject. self.rejects.append("%s: Found lintian output: '%s %s', automatically rejected package." % (epackage, etag, etext)) + log("auto rejecting", etag) # Now tell if they *might* override it. if etag in lintiantags['warning']: self.rejects.append("%s: If you have a good reason, you may override this lintian tag." % (epackage))