The following commit has been merged in the master branch:
commit 2cc6a4fa9d1d4be253d24876ef5fef74ca6f7dce
Author: Akshita Jha <[email protected]>
Date: Fri Jul 31 19:25:32 2015 +0530
Modify blendstasktools_udd.py : Make use of the prepared query 'query_vcs'
to fetch prospective package information
diff --git a/webtools_py3/blendstasktools_udd.py
b/webtools_py3/blendstasktools_udd.py
index cb248da..9bf155a 100644
--- a/webtools_py3/blendstasktools_udd.py
+++ b/webtools_py3/blendstasktools_udd.py
@@ -411,7 +411,7 @@ query = """PREPARE query_vcs (text[]) AS SELECT
LEFT OUTER JOIN bibref bibnumber ON p.source = bibnumber.source AND
bibnumber.rank = 0 AND bibnumber.key = 'number' AND bibnumber.package = ''
LEFT OUTER JOIN bibref bibpages ON p.source = bibpages.source AND
bibpages.rank = 0 AND bibpages.key = 'pages' AND bibpages.package = ''
LEFT OUTER JOIN bibref bibeprint ON p.source = bibeprint.source AND
bibeprint.rank = 0 AND bibeprint.key = 'eprint' AND bibeprint.package = ''
- WHERE p.package = ANY ($1)"""
+ WHERE p.package = ANY ($1) ORDER BY p.package"""
_execute_udd_query(query)
# This prepared statement is called only once but it makes sense to mention it
in the
@@ -1085,11 +1085,13 @@ class TaskDependencies:
# If a package is not found in main its status can be
maximum non-free
dep.pkgstatus = 'non-free'
elif pkg_src == 2:
- dep.pkgstatus = 'pkgvcs'
+ dep.component = row['component']
+ dep.pkgstatus = 'pkgvcs'
+ dep.version = [row['version'],]
# if a package is released *only* in experimental decrease package
status
if 'release' in row and row['release'] == 'experimental':
- dep.pkgstatus = 'experimental'
+ dep.pkgstatus = 'experimental'
if dep.dep_strength == 'i':
dep.pkgstatus = 'ignore'
@@ -1097,37 +1099,22 @@ class TaskDependencies:
dep.pkgstatus = 'avoid'
# license
- if dep.component != None:
+ if dep.component != None and pkg_src != 2:
dep.properties['license'] = license_in_component[dep.component]
for prop in PROPERTIES:
dep.properties[prop] = row[prop]
- type_vcs = ''
- if 'vcs_type' in row :
- type_vcs = 'vcs_type'
- elif 'vcs-type' in row:
- type_vcs = 'vcs-type'
- if type_vcs != '':
- dep.properties['vcs-type'] = row[type_vcs]
-
- type_url = ''
- if 'vcs_url' in row :
- type_url = 'vcs_url'
- elif 'vcs-url' in row:
- type_url = 'vcs-url'
- if type_url != '':
- dep.properties['vcs-url'] = row[type_url]
-
- type_browser = ''
- if 'vcs_browser' in row :
- type_browser = 'vcs_browser'
- elif 'vcs-browser' in row:
- type_browser = 'vcs-browser'
- if type_browser != '':
- dep.properties['vcs-browser'] = row[type_browser]
- elif dep.properties['vcs-browser'] == HOMEPAGENONE and type_vcs !=
'' and type_url != '':
- dep.properties['vcs-browser'] =
BrowserFromVcsURL(dep.properties['vcs-type'], dep.properties['vcs-url'])
+ if 'vcs-type' in row:
+ dep.properties['vcs-type'] = row['vcs-type']
+
+ if 'vcs-url' in row:
+ dep.properties['vcs-url'] = row['vcs-url']
+
+ if 'vcs-browser' in row:
+ dep.properties['vcs-browser'] = row['vcs-browser']
+ if dep.properties['vcs-browser'] == HOMEPAGENONE: # and
type_vcs != '' and type_url != '':
+ dep.properties['vcs-browser'] =
BrowserFromVcsURL(dep.properties['vcs-type'], dep.properties['vcs-url'])
# enhances to be written
# if row['enhanced']:
@@ -1286,22 +1273,8 @@ class TaskDependencies:
alldepends.append(dep.pkg)
dependencies.append(dep)
-
- query = "SELECT DISTINCT bp.package, bp.license, b.dependency,
bp.component, bp.homepage, bp.section, \
- bp.source, bp.vcs_type, bp.vcs_url, bp.vcs_browser,
bp.changed_by, \
- bp.uploaders, bp.maintainer, pop.vote, pop.recent,
tags.debtags, bp.description AS description_en, bp.long_description AS
long_description_en\
- FROM blends_prospectivepackages bp JOIN blends_dependencies b
ON b.blend=bp.blend AND b.package=bp.package \
- LEFT OUTER JOIN popcon pop ON pop.package=bp.package \
- LEFT OUTER JOIN ( \
- SELECT package, array_agg(tag) AS debtags \
- FROM debtags \
- WHERE tag NOT LIKE 'implemented-in::%%' \
- AND tag NOT LIKE 'protocol::%%' \
- AND tag NOT LIKE '%%::TODO' \
- AND tag NOT LIKE '%%not-yet-tagged%%' \
- GROUP BY package \
- ) tags ON tags.package = bp.package \
- WHERE bp.blend='%s' and b.task='%s' ORDER BY bp.package" %
(self.blendname, self.task)
+
+ query = "EXECUTE query_vcs('%s')" % List2PgArray(alldepends)
_execute_udd_query(query)
if curs.rowcount > 0:
self.GetDepInfo(curs, dependencies, 2)
--
Static and dynamic websites for Debian Pure Blends
_______________________________________________
Blends-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/blends-commit