This change makes generage-packages-sources2 use the Section and
Priority values provided by the package in case no override is
present.
With this change, automatic override packages do not require manual
override handling. It is also useful for testing purposes or possibly
users with other workflows than Debian's.
f.size AS size,
f.md5sum AS md5sum,
f.sha1sum AS sha1sum,
f.size AS size,
f.md5sum AS md5sum,
f.sha1sum AS sha1sum,
- f.sha256sum AS sha256sum
+ f.sha256sum AS sha256sum,
+ (SELECT value FROM binaries_metadata
+ WHERE bin_id = b.id
+ AND key_id = (SELECT key_id FROM metadata_keys WHERE key = 'Priority'))
+ AS fallback_priority,
+ (SELECT value FROM binaries_metadata
+ WHERE bin_id = b.id
+ AND key_id = (SELECT key_id FROM metadata_keys WHERE key = 'Section'))
+ AS fallback_section
FROM
binaries b
JOIN bin_associations ba ON b.id = ba.bin
FROM
binaries b
JOIN bin_associations ba ON b.id = ba.bin
eo.package = tmp.package
AND eo.suite = :overridesuite AND eo.component = :component
), '')
eo.package = tmp.package
AND eo.suite = :overridesuite AND eo.component = :component
), '')
- || E'\nSection\: ' || sec.section
- || E'\nPriority\: ' || pri.priority
+ || E'\nSection\: ' || COALESCE(sec.section, tmp.fallback_section)
+ || E'\nPriority\: ' || COALESCE(pri.priority, tmp.fallback_priority)
|| E'\nFilename\: pool/' || :component_name || '/' || tmp.filename
|| E'\nSize\: ' || tmp.size
|| E'\nMD5sum\: ' || tmp.md5sum
|| E'\nFilename\: pool/' || :component_name || '/' || tmp.filename
|| E'\nSize\: ' || tmp.size
|| E'\nMD5sum\: ' || tmp.md5sum
- JOIN override o ON o.package = tmp.package
- JOIN section sec ON sec.id = o.section
- JOIN priority pri ON pri.id = o.priority
+ LEFT JOIN override o ON o.package = tmp.package
+ AND o.type = :type_id
+ AND o.suite = :overridesuite
+ AND o.component = :component
+ LEFT JOIN section sec ON sec.id = o.section
+ LEFT JOIN priority pri ON pri.id = o.priority
OR
(architecture = :arch_all AND source NOT IN (SELECT DISTINCT source FROM tmp WHERE architecture <> :arch_all))
)
OR
(architecture = :arch_all AND source NOT IN (SELECT DISTINCT source FROM tmp WHERE architecture <> :arch_all))
)
- AND
- o.type = :type_id AND o.suite = :overridesuite AND o.component = :component
ORDER BY tmp.source, tmp.package, tmp.version
"""
ORDER BY tmp.source, tmp.package, tmp.version
"""