new: add Standards-Version to generated control
This commit is contained in:
@@ -23,6 +23,11 @@ pub const SOURCE_FORMAT_NATIVE: &str = "3.0 (native)";
|
|||||||
/// The three source formats pkh knows how to build.
|
/// The three source formats pkh knows how to build.
|
||||||
pub const KNOWN_SOURCE_FORMATS: [&str; 3] = [SOURCE_FORMAT_QUILT, SOURCE_FORMAT_NATIVE, "1.0"];
|
pub const KNOWN_SOURCE_FORMATS: [&str; 3] = [SOURCE_FORMAT_QUILT, SOURCE_FORMAT_NATIVE, "1.0"];
|
||||||
|
|
||||||
|
/// Current Debian Policy version, written as the `Standards-Version` of the
|
||||||
|
/// generated `debian/control` (mandatory in the source stanza per policy).
|
||||||
|
/// Bump as policy evolves.
|
||||||
|
pub const DEBIAN_POLICY_VERSION: &str = "4.7.4";
|
||||||
|
|
||||||
/// Directory and file names excluded from the orig tarball, at any depth of
|
/// Directory and file names excluded from the orig tarball, at any depth of
|
||||||
/// the tree.
|
/// the tree.
|
||||||
const ORIG_EXCLUDE: &[&str] = &[
|
const ORIG_EXCLUDE: &[&str] = &[
|
||||||
@@ -197,6 +202,7 @@ fn control(opts: &NewOptions, template: &dyn Template) -> OutputFile {
|
|||||||
opts.maintainer.0, opts.maintainer.1
|
opts.maintainer.0, opts.maintainer.1
|
||||||
));
|
));
|
||||||
control.push_str("Rules-Requires-Root: no\n");
|
control.push_str("Rules-Requires-Root: no\n");
|
||||||
|
control.push_str(&format!("Standards-Version: {DEBIAN_POLICY_VERSION}\n"));
|
||||||
|
|
||||||
let mut build_depends = vec!["debhelper-compat (= 13)".to_string()];
|
let mut build_depends = vec!["debhelper-compat (= 13)".to_string()];
|
||||||
build_depends.extend(template.build_depends(opts));
|
build_depends.extend(template.build_depends(opts));
|
||||||
@@ -601,6 +607,10 @@ mod tests {
|
|||||||
assert_eq!(parsed.source.get("Section"), Some("utils"));
|
assert_eq!(parsed.source.get("Section"), Some("utils"));
|
||||||
assert_eq!(parsed.source.get("Priority"), Some("optional"));
|
assert_eq!(parsed.source.get("Priority"), Some("optional"));
|
||||||
assert_eq!(parsed.source.get("Rules-Requires-Root"), Some("no"));
|
assert_eq!(parsed.source.get("Rules-Requires-Root"), Some("no"));
|
||||||
|
assert_eq!(
|
||||||
|
parsed.source.get("Standards-Version"),
|
||||||
|
Some(DEBIAN_POLICY_VERSION)
|
||||||
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parsed.source.get("Homepage"),
|
parsed.source.get("Homepage"),
|
||||||
Some("https://example.com/mytool")
|
Some("https://example.com/mytool")
|
||||||
|
|||||||
Reference in New Issue
Block a user