]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'stew/master' into merge
authorJoerg Jaspert <joerg@debian.org>
Thu, 15 Jan 2009 00:44:38 +0000 (01:44 +0100)
committerJoerg Jaspert <joerg@debian.org>
Thu, 15 Jan 2009 00:44:38 +0000 (01:44 +0100)
* commit 'stew/master':
  make examine_package check dependencies based on suite
  Get rid of non ascii character in source file.
  update dinstall.html for 4 daily dinstall runs
  fix removals rss feed when there are fewer than 16 removals

Signed-off-by: Joerg Jaspert <joerg@debian.org>
1  2 
dak/examine_package.py

diff --combined dak/examine_package.py
index c7ab7ad5865c8d9619cd9951acc8086e2610bbad,f7f3f0d5984225336417f2763cfe4a01e3355fe6..49d18dc685dfabb0668e9b70c76833c39d6dd336
@@@ -271,7 -271,7 +271,7 @@@ def read_control (filename)
  
      return (control, control_keys, section, depends, recommends, arch, maintainer)
  
- def read_changes_or_dsc (filename):
+ def read_changes_or_dsc (suite, filename):
      dsc = {}
  
      dsc_file = utils.open_file(filename)
  
      for k in dsc.keys():
          if k in ("build-depends","build-depends-indep"):
-             dsc[k] = create_depends_string(split_depends(dsc[k]))
+             dsc[k] = create_depends_string(suite, split_depends(dsc[k]))
          elif k == "architecture":
              if (dsc["architecture"] != "any"):
                  dsc['architecture'] = colour_output(dsc["architecture"], 'arch')
      filecontents = '\n'.join(map(lambda x: format_field(x,dsc[x.lower()]), keysinorder))+'\n'
      return filecontents
  
- def create_depends_string (depends_tree):
-     # just look up unstable for now. possibly pull from .changes later
-     suite = "unstable"
+ def create_depends_string (suite, depends_tree):
      result = ""
+     if suite == 'experimental':
+         suite_where = " in ('experimental','unstable')"
+     else:
+         suite_where = " ='%s'" % suite
      comma_count = 1
      for l in depends_tree:
          if (comma_count >= 2):
                  result += " | "
              # doesn't do version lookup yet.
  
-             q = projectB.query("SELECT DISTINCT(b.package), b.version, c.name, su.suite_name FROM  binaries b, files fi, location l, component c, bin_associations ba, suite su WHERE b.package='%s' AND b.file = fi.id AND fi.location = l.id AND l.component = c.id AND ba.bin=b.id AND ba.suite = su.id AND su.suite_name='%s' ORDER BY b.version desc" % (d['name'], suite))
+             q = projectB.query("SELECT DISTINCT(b.package), b.version, c.name, su.suite_name FROM  binaries b, files fi, location l, component c, bin_associations ba, suite su WHERE b.package='%s' AND b.file = fi.id AND fi.location = l.id AND l.component = c.id AND ba.bin=b.id AND ba.suite = su.id AND su.suite_name %s ORDER BY b.version desc" % (d['name'], suite_where))
              ql = q.getresult()
              if ql:
                  i = ql[0]
          comma_count += 1
      return result
  
- def output_deb_info(filename):
+ def output_deb_info(suite, filename):
      (control, control_keys, section, depends, recommends, arch, maintainer) = read_control(filename)
  
      if control == '':
      to_print = ""
      for key in control_keys :
          if key == 'Depends':
-             field_value = create_depends_string(depends)
+             field_value = create_depends_string(suite, depends)
          elif key == 'Recommends':
-             field_value = create_depends_string(recommends)
+             field_value = create_depends_string(suite, recommends)
          elif key == 'Section':
              field_value = section
          elif key == 'Architecture':
@@@ -411,12 -414,12 +414,12 @@@ def get_copyright (deb_filename)
          printed_copyrights[copyrightmd5] = "%s (%s)" % (package, deb_filename)
      return res+formatted_text(cright)
  
- def check_dsc (dsc_filename):
-     (dsc) = read_changes_or_dsc(dsc_filename)
+ def check_dsc (suite, dsc_filename):
+     (dsc) = read_changes_or_dsc(suite, dsc_filename)
      foldable_output(dsc_filename, "dsc", dsc, norow=True)
      foldable_output("lintian check for %s" % dsc_filename, "source-lintian", do_lintian(dsc_filename))
  
- def check_deb (deb_filename):
+ def check_deb (suite, deb_filename):
      filename = os.path.basename(deb_filename)
      packagename = filename.split('_')[0]
  
  
  
      foldable_output("control file for %s" % (filename), "binary-%s-control"%packagename,
-                     output_deb_info(deb_filename), norow=True)
+                     output_deb_info(suite, deb_filename), norow=True)
  
      if is_a_udeb:
          foldable_output("skipping lintian check for udeb", "binary-%s-lintian"%packagename,
@@@ -477,20 -480,20 +480,20 @@@ def strip_pgp_signature (filename)
      file.close()
      return contents
  
- def display_changes(changes_filename):
-     changes = read_changes_or_dsc(changes_filename)
+ def display_changes(suite, changes_filename):
+     changes = read_changes_or_dsc(suite, changes_filename)
      foldable_output(changes_filename, "changes", changes, norow=True)
  
  def check_changes (changes_filename):
-     display_changes(changes_filename)
      changes = utils.parse_changes (changes_filename)
+     display_changes(changes['distribution'], changes_filename)
      files = utils.build_file_list(changes)
      for f in files.keys():
          if f.endswith(".deb") or f.endswith(".udeb"):
-             check_deb(f)
+             check_deb(changes['distribution'], f)
          if f.endswith(".dsc"):
-             check_dsc(f)
+             check_dsc(changes['distribution'], f)
          # else: => byhand
  
  def main ():
                  if f.endswith(".changes"):
                      check_changes(f)
                  elif f.endswith(".deb") or f.endswith(".udeb"):
-                     check_deb(file)
 -                    # default to unstable when we don't have a .changes file 
++                    # default to unstable when we don't have a .changes file
+                     # perhaps this should be a command line option?
 -                    check_deb('unstable', file) 
++                    check_deb('unstable', file)
                  elif f.endswith(".dsc"):
-                     check_dsc(f)
+                     check_dsc('unstable', f)
                  else:
                      utils.fubar("Unrecognised file type: '%s'." % (f))
              finally: