X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fgenerate_packages_sources2.py;h=151920c1fda001a37733c78f9a5214b1c2694671;hb=7de6bf94ac8324bfb62a6d7a5efc340dca894907;hp=8290cca32a61f03082bedec81dd3bc55a2294a2a;hpb=83cd5dfad25f243cd0ee7a0c5f2b66eb18871e16;p=dak.git diff --git a/dak/generate_packages_sources2.py b/dak/generate_packages_sources2.py index 8290cca3..151920c1 100755 --- a/dak/generate_packages_sources2.py +++ b/dak/generate_packages_sources2.py @@ -38,11 +38,6 @@ Generate the Packages/Sources files 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. @@ -59,11 +54,11 @@ SELECT (SELECT STRING_AGG( CASE - WHEN key = 'Source' THEN 'Package\: ' + WHEN key = 'Source' THEN E'Package\: ' WHEN key = 'Files' THEN E'Files\:\n ' || f.md5sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z') WHEN key = 'Checksums-Sha1' THEN E'Checksums-Sha1\:\n ' || f.sha1sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z') WHEN key = 'Checksums-Sha256' THEN E'Checksums-Sha256\:\n ' || f.sha256sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z') - ELSE key || '\: ' + ELSE key || E'\: ' END || value, E'\n' ORDER BY mk.ordering, mk.key) FROM source_metadata sm @@ -156,7 +151,7 @@ WITH SELECT (SELECT - STRING_AGG(key || '\: ' || value, E'\n' ORDER BY ordering, key) + STRING_AGG(key || E'\: ' || value, E'\n' ORDER BY ordering, key) FROM (SELECT key, ordering, CASE WHEN :include_long_description = 'false' AND key = 'Description' @@ -172,7 +167,7 @@ SELECT ) AS metadata ) || COALESCE(E'\n' || (SELECT - STRING_AGG(key || '\: ' || value, E'\n' ORDER BY key) + STRING_AGG(key || E'\: ' || value, E'\n' ORDER BY key) FROM external_overrides eo WHERE eo.package = tmp.package @@ -206,7 +201,7 @@ WHERE 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 @@ -221,7 +216,7 @@ def generate_packages(suite_id, component_id, architecture_id, type_name, use_de architecture = session.query(Architecture).get(architecture_id) overridesuite_id = suite.get_overridesuite().suite_id - include_long_description = suite.include_long_description or not use_description_md5 + 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 @@ -260,7 +255,7 @@ WITH FROM suite AS s LEFT JOIN suite AS os ON s.overridesuite = os.suite_name) SELECT - 'Package\: ' || b.package + E'Package\: ' || b.package || E'\nDescription-md5\: ' || bm_description_md5.value || E'\nDescription-en\: ' || bm_description.value || E'\n' @@ -278,8 +273,8 @@ FROM binaries b JOIN source s ON b.source = s.id WHERE ba.suite = :suite AND o.component = :component -GROUP BY s.source, b.package, bm_description_md5.value, bm_description.value -ORDER BY s.source, b.package, bm_description_md5.value +GROUP BY b.package, bm_description_md5.value, bm_description.value +ORDER BY MIN(s.source), b.package, bm_description_md5.value """ def generate_translations(suite_id, component_id): @@ -314,7 +309,6 @@ def main(): 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')] @@ -350,7 +344,6 @@ def main(): 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() ] @@ -367,16 +360,17 @@ def main(): 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()