/[qa]/trunk/pts/www/bin/sources_to_xml.py
ViewVC logotype

Diff of /trunk/pts/www/bin/sources_to_xml.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1953 by zack, Mon Aug 11 18:45:08 2008 UTC revision 2273 by hertzog, Wed Sep 23 20:35:47 2009 UTC
# Line 1  Line 1 
1  #!/usr/bin/python  #!/usr/bin/python
2  # -*- coding: utf8 -*-  # -*- coding: utf-8 -*-
3    
4  # vim: expandtab  # vim: expandtab
5    
# Line 11  import os.path, rfc822, email, email.Uti Line 11  import os.path, rfc822, email, email.Uti
11  from xml.dom import implementation, ext  from xml.dom import implementation, ext
12    
13  from config import dir, odir  from config import dir, odir
14  from common import vcs_table  from common import vcs_table, hash_name
15    
16  # address_from_string takes an address in RFC822 format  # address_from_string takes an address in RFC822 format
17  # and turns it into a tuple of the form (real name, email).  # and turns it into a tuple of the form (real name, email).
# Line 52  def update_sources_info(m, dist): Line 52  def update_sources_info(m, dist):
52      """Update the XML information with the given Message (Package entry)"""      """Update the XML information with the given Message (Package entry)"""
53      global odir, old_done, new_done, new_dist_map      global odir, old_done, new_done, new_dist_map
54      package = m["Package"]      package = m["Package"]
55      hash = package[0]      hash = hash_name(package)
     if package[0:3] == "lib":  
         hash = package[0:4]  
56      # Check if the work has already been done      # Check if the work has already been done
57      key = "%s_%s_%s" % (m["Package"], m["Version"], dist)      key = "%s_%s_%s" % (m["Package"], m["Version"], dist)
58      new_done[key] = 1      new_done[key] = 1
# Line 77  def update_sources_info(m, dist): Line 75  def update_sources_info(m, dist):
75          child = doc.createElement(tag)          child = doc.createElement(tag)
76          root.appendChild(child)          root.appendChild(child)
77          if tag == "binary" or tag[0:5] == "build":          if tag == "binary" or tag[0:5] == "build":
78              for item in re.split(", ?", m[tag]):              for item in re.split(",[ \n]*", m[tag]):
79                  # Take care of non-ascii, prevents troubles...                  # Take care of non-ascii, prevents troubles...
80                  text = doc.createTextNode(unicode(item,'ISO-8859-1','replace'))                  text = doc.createTextNode(unicode(item,'ISO-8859-1','replace'))
81                  item_elt = doc.createElement("item")                  item_elt = doc.createElement("item")
# Line 180  f.close() Line 178  f.close()
178  for key in old_done.keys():  for key in old_done.keys():
179      (p, v, d) = key.split("_", 2)      (p, v, d) = key.split("_", 2)
180      if not new_dist_map.has_key("%s_%s" % (p, d)):      if not new_dist_map.has_key("%s_%s" % (p, d)):
181          hash = p[0]          hash = hash_name(p)
         if p[0:3] == "lib":  
             hash = p[0:4]  
182          filename = "%s/%s/%s/%s.xml" % (odir, hash, p, d)          filename = "%s/%s/%s/%s.xml" % (odir, hash, p, d)
183          filenamerebuild = "%s/%s/%s/force-rebuild" % (odir, hash, p)          filenamerebuild = "%s/%s/%s/force-rebuild" % (odir, hash, p)
184          if os.path.exists(filename):          if os.path.exists(filename):

Legend:
Removed from v.1953  
changed lines
  Added in v.2273

  ViewVC Help
Powered by ViewVC 1.1.5