]> git.decadent.org.uk Git - dak.git/commitdiff
Merge branch 'merge'
authorJoerg Jaspert <joerg@debian.org>
Wed, 28 Oct 2009 15:30:25 +0000 (16:30 +0100)
committerJoerg Jaspert <joerg@debian.org>
Wed, 28 Oct 2009 15:30:25 +0000 (16:30 +0100)
* merge:
  Fix return type.
  Don't call check_* due when we are running with No-Action
  While we're at it, split out another version of ensure_orig_files.
  check_lintian needs all the source, otherwise we can't check the package.
  Factor out symlink stuff from get_changelog_versions => ensure_all_source_exists

1  2 
dak/process_unchecked.py
daklib/queue.py

diff --combined dak/process_unchecked.py
index 5688e83f2b873fd3b77eab15b3a857c297375d91,f7caf303192ec07993888dd5b6aff94fe609fa4e..5463f1a6521a7219332614396359719b13aca514
@@@ -455,7 -455,7 +455,7 @@@ def process_it(changes_file)
      u.pkg.changes["changedby2047"] = cnf["Dinstall::MyEmailAddress"]
  
      # debian-{devel-,}-changes@lists.debian.org toggles writes access based on this header
 -    bcc = "X-DAK: dak process-unchecked\nX-Katie: $Revision: 1.65 $"
 +    bcc = "X-DAK: dak process-unchecked"
      if cnf.has_key("Dinstall::Bcc"):
          u.Subst["__BCC__"] = bcc + "\nBcc: %s" % (cnf["Dinstall::Bcc"])
      else:
                  u.check_distributions()
                  u.check_files(not Options["No-Action"])
                  valid_dsc_p = u.check_dsc(not Options["No-Action"])
-                 if valid_dsc_p:
+                 if valid_dsc_p and not Options["No-Action"]:
                      u.check_source()
                      u.check_lintian()
                  u.check_hashes()
diff --combined daklib/queue.py
index 1d2a3275fc43ac8f29d062affa974a3f3efc6d6f,0c79a260be58fbe04e1dab92bd0de1d2aae74828..f7d999a3da7220135d89d522ac87948775182199
@@@ -1025,21 -1025,16 +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():
              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)
          if not valid_dist:
              return
  
+         self.ensure_all_source_exists()
          cnf = Config()
 -        tagfile = cnf["Dinstall::LintianTags"]
 +        tagfile = cnf.get("Dinstall::LintianTags")
 +        if tagfile is None:
 +            # We don't have a tagfile, so just don't do anything.
 +            return
          # Parse the yaml file
          sourcefile = file(tagfile, 'r')
          sourcecontent = sourcefile.read()
@@@ -1918,7 -1932,7 +1935,7 @@@ distribution.""
          if not manual:
              self.Subst["__REJECTOR_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"]
              self.Subst["__MANUAL_REJECT_MESSAGE__"] = ""
 -            self.Subst["__CC__"] = "X-DAK-Rejection: automatic (moo)\nX-Katie-Rejection: automatic (moo)"
 +            self.Subst["__CC__"] = "X-DAK-Rejection: automatic (moo)"
              os.write(reason_fd, reject_message)
              reject_mail_message = utils.TemplateSubst(self.Subst, rej_template)
          else:
          self.Subst["__REJECTOR_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"]
          self.Subst["__REJECT_MESSAGE__"] = self.package_info()
          self.Subst["__CC__"] = "Cc: " + cnf["Dinstall::MyEmailAddress"]
 -        self.Subst["__BCC__"] = "X-DAK: dak process-accepted\nX-Katie: $Revision: 1.18 $"
 +        self.Subst["__BCC__"] = "X-DAK: dak process-accepted"
          if cnf.has_key("Dinstall::Bcc"):
              self.Subst["__BCC__"] += "\nBcc: %s" % (cnf["Dinstall::Bcc"])