0.3.1 |
|
---|---|
0.3.0 |
|
0.2.0 |
|
#20 in #deb
22KB
416 代码行
deb-control-rs
用于在 Rust 中生成 DEB/control 文件的包
使用方法
此包提供了一个简单的构建器接口用于生成 DEB/control 文件。有两种类型的构建器:二进制和源。要访问它们,请使用 DebControlBuilder
的相关函数,例如
use deb_control::DebControlBuilder;
DebControlBuilder::binary_package_builder();
// or
DebControlBuilder::source_package_builder();
以下是从头开始构建二进制 DEB/control 的示例
use deb_control::DebControlBuilder;
fn main() -> Result<(), std::boxed::Box<dyn std::error::Error + 'static + Sync + Send>> {
let control = DebControlBuilder::binary_package_builder("debcontrol")
.source("package.tar.gz")
.version("1")
.architecture("any")
.maintainer("Wojciech Kępka <[email protected]>")
.description("crate for DEB/control file generation")
.essential(true)
.section("devel")
.homepage("https://github.com/wojciechkepka/debcontrol")
.built_using("rustc")
.add_pre_depends_entries(vec!["rustc", "cargo"])
.add_depends_entries(vec!["rustc", "cargo"])
.add_conflicts_entries(vec!["rustc", "cargo"])
.add_provides_entries(vec!["rustc", "cargo"])
.add_replaces_entries(vec!["rustc", "cargo"])
.add_enchances_entries(vec!["rustc", "cargo"])
.add_provides_entries(vec!["debcontrol"])
.build();
// you can later render it to a string like so:
let _rendered = control.render()?;
// or save it directly to a file
control.save_to("/tmp/CONTROL")?;
Ok(())
}
许可证
依赖项
~1.5MB
~35K SLoC