Default: All suites not marked 'untouchable'
-f, --force Allow processing of untouchable suites
CAREFUL: Only to be used at point release time!
- -5, --description-md5 Allow to use Description-md5 instead of
- Description for Packages index and generate
- Translation-en
- NOTE: suite.include_long_descriptions needs to
- be set to false for this.
-h, --help show this help and exit
SUITE can be a space seperated list, e.g.
SELECT
(SELECT
- STRING_AGG(key || '\: ' || value, E'\n' ORDER BY mk.ordering, mk.key)
+ STRING_AGG(key || '\: ' || value, E'\n' ORDER BY ordering, key)
FROM
- binaries_metadata bm
- JOIN metadata_keys mk ON mk.key_id = bm.key_id
- WHERE
- bm.bin_id = tmp.binary_id
- AND key != ALL (:metadata_skip)
+ (SELECT key, ordering,
+ CASE WHEN :include_long_description = 'false' AND key = 'Description'
+ THEN SUBSTRING(value FROM E'\\A[^\n]*')
+ ELSE value
+ END AS value
+ FROM
+ binaries_metadata bm
+ JOIN metadata_keys mk ON mk.key_id = bm.key_id
+ WHERE
+ bm.bin_id = tmp.binary_id
+ AND key != ALL (:metadata_skip)
+ ) AS metadata
)
|| COALESCE(E'\n' || (SELECT
STRING_AGG(key || '\: ' || value, E'\n' ORDER BY key)
ORDER BY tmp.source, tmp.package, tmp.version
"""
-def generate_packages(suite_id, component_id, architecture_id, type_name, use_description_md5):
+def generate_packages(suite_id, component_id, architecture_id, type_name):
global _packages_query
from daklib.filewriter import PackagesFileWriter
from daklib.dbconn import Architecture, Component, DBConn, OverrideType, Suite
architecture = session.query(Architecture).get(architecture_id)
overridesuite_id = suite.get_overridesuite().suite_id
+ include_long_description = suite.include_long_description
# We currently filter out the "Tag" line. They are set by external
# overrides and NOT by the maintainer. And actually having it set by
# maintainer means we output it twice at the moment -> which breaks
# dselect.
metadata_skip = ["Section", "Priority", "Tag"]
- if suite.include_long_description or not use_description_md5:
+ if include_long_description:
metadata_skip.append("Description-md5")
- else:
- metadata_skip.append("Description")
writer = PackagesFileWriter(suite=suite.suite_name, component=component.component_name,
architecture=architecture.arch_string, debtype=type_name)
r = session.execute(_packages_query, {"suite": suite_id, "component": component_id,
"arch": architecture_id, "type_id": type_id, "type_name": type_name, "arch_all": arch_all_id,
- "overridesuite": overridesuite_id, "metadata_skip": metadata_skip})
+ "overridesuite": overridesuite_id, "metadata_skip": metadata_skip,
+ "include_long_description": 'true' if include_long_description else 'false'})
for (stanza,) in r:
print >>output, stanza
print >>output, ""
cnf = Config()
Arguments = [('h',"help","Generate-Packages-Sources::Options::Help"),
- ('5','description-md5',"Generate-Packages-Sources::Options::Description-md5"),
('s',"suite","Generate-Packages-Sources::Options::Suite"),
('f',"force","Generate-Packages-Sources::Options::Force"),
('o','option','','ArbItem')]
else:
suites = session.query(Suite).filter(Suite.untouchable == False).all()
- use_description_md5 = Options.has_key("Description-md5") and Options["Description-md5"]
force = Options.has_key("Force") and Options["Force"]
component_ids = [ c.component_id for c in session.query(Component).all() ]
for s in suites:
if s.untouchable and not force:
+ import utils
utils.fubar("Refusing to touch %s (untouchable and not forced)" % s.suite_name)
for c in component_ids:
pool.apply_async(generate_sources, [s.suite_id, c], callback=parse_results)
- if use_description_md5 and not s.include_long_description:
+ if not s.include_long_description:
pool.apply_async(generate_translations, [s.suite_id, c], callback=parse_results)
for a in s.architectures:
if a == 'source':
continue
- pool.apply_async(generate_packages, [s.suite_id, c, a.arch_id, 'deb', use_description_md5], callback=parse_results)
- pool.apply_async(generate_packages, [s.suite_id, c, a.arch_id, 'udeb', use_description_md5], callback=parse_results)
+ pool.apply_async(generate_packages, [s.suite_id, c, a.arch_id, 'deb'], callback=parse_results)
+ pool.apply_async(generate_packages, [s.suite_id, c, a.arch_id, 'udeb'], callback=parse_results)
pool.close()
pool.join()