[Blends-commit] r2626 - /blends/trunk/webtools/blendstasktools.py

tille at users.alioth.debian.org tille at users.alioth.debian.org
Wed Jan 26 15:54:46 UTC 2011


Author: tille
Date: Wed Jan 26 15:54:45 2011
New Revision: 2626

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=2626
Log:
Changed_by of ftpnew packages

Modified:
    blends/trunk/webtools/blendstasktools.py

Modified: blends/trunk/webtools/blendstasktools.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/webtools/blendstasktools.py?rev=2626&op=diff
==============================================================================
--- blends/trunk/webtools/blendstasktools.py (original)
+++ blends/trunk/webtools/blendstasktools.py Wed Jan 26 15:54:45 2011
@@ -294,13 +294,16 @@
 _execute_udd_query(query)
 
 query = """PREPARE query_new (text[]) AS SELECT
-                   package,
-                   distribution, component, version, architecture, maintainer,
-                   source, section, distribution, 'new' AS release, component, homepage,
+                   p.package,
+                   p.distribution, p.component, p.version, p.architecture, p.maintainer,
+                   p.source, p.section, p.distribution, 'new' AS release, p.component, p.homepage,
+                   s.changed_by,
                    description AS description_en, long_description AS long_description_en
-                   FROM new_packages 
-                   WHERE (package, version) IN  
-                         (SELECT package, max(version) FROM new_packages WHERE package = ANY ($1) GROUP BY package)"""
+                   FROM new_packages p
+		   JOIN new_sources s ON p.source = s.source AND p.version = s.version
+                   WHERE (p.package, p.version) IN  
+                         (SELECT package, max(version) FROM
+                   new_packages WHERE package = ANY ($1) GROUP BY package)"""
 _execute_udd_query(query)
 
 # This prepared statement is called only once but it makes sense to mention it in the
@@ -1479,6 +1482,21 @@
                 dep.desc['en']['long']  = Markup(render_longdesc(row['long_description_en'].splitlines()))
                 (_name, _url) = email.Utils.parseaddr(row['maintainer'])
                 dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, to_unicode(_name))
+                if row['changed_by']:
+                    try:
+                        changed = to_unicode(row['changed_by'])
+                    except TypeError, err:
+                        changed = None
+                        logger.warning("Encoding problem for uploader to ftpnew of package '%s' in task %s (%s)" % (dep.pkg, dep.taskname, err))
+                    if changed:
+                        try:
+                            (_name, _url) = email.Utils.parseaddr(changed)
+                            changed = '<a href="mailto:%s">%s</a>' % (_url, _name)
+                            dep.properties['changed_by']    = MarkupString(changed, dep.pkg, 'changed_by')
+                            dep.properties['last_uploader'] = to_unicode(changed)
+                            dep.properties['last_uploader_simple'] = to_unicode('%s <%s>' % (_name, _url))
+                        except UnicodeDecodeError, err:
+                            logger.error("Encoding problem for last uploader - assume same as maintainer for package %s (%s)", dep.pkg, err)
 
         # Verify whether there are virtual packages which are provided by some other packages in the list of dependencies
         query = "EXECUTE query_provides('%s')" % List2PgArray(pkgs_in_pool)




More information about the Blends-commit mailing list