pub struct NfpmContent {
pub src: String,
pub dst: String,
pub content_type: Option<String>,
pub file_info: Option<NfpmFileInfo>,
pub packager: Option<String>,
pub expand: Option<bool>,
}Expand description
A single file/directory entry in an nFPM (or SRPM) package’s contents
list. Merged the formerly-separate NfpmContentConfig
(used for SRPM) into this struct — source / destination / type are
accepted as aliases for src / dst / the renamed type so srpm-style
keys still parse.
Default is intentionally not derived because src and dst are
required fields with no meaningful defaults — forcing callers to provide
them explicitly prevents accidentally packaging empty paths.
Fields§
§src: StringSource path on the build machine (supports glob patterns and templates).
Paths are resolved relative to the project root. .. segments are
NOT stripped, so a templated value resolving to ../../etc/passwd
will reach outside the project tree — avoid splicing untrusted
template inputs (e.g. arbitrary {{ .Env.X }} values) into src.
dst: StringDestination path inside the package (absolute path, supports templates).
Same caveat as src: .. segments are passed through to nfpm
verbatim. Templated values from untrusted sources should be
canonicalised by the caller before use.
content_type: Option<String>Content entry type: “config”, “config|noreplace”, “doc”, “dir”, “symlink”, “ghost”, or empty for regular file.
file_info: Option<NfpmFileInfo>File ownership and permission metadata.
packager: Option<String>Per-packager filter: only include this content entry for the specified packager (e.g. “deb”, “rpm”, “apk”).
expand: Option<bool>When true, expand template variables in the src and dst paths.
Trait Implementations§
Source§impl Clone for NfpmContent
impl Clone for NfpmContent
Source§fn clone(&self) -> NfpmContent
fn clone(&self) -> NfpmContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NfpmContent
impl Debug for NfpmContent
Source§impl<'de> Deserialize<'de> for NfpmContent
impl<'de> Deserialize<'de> for NfpmContent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for NfpmContent
impl JsonSchema for NfpmContent
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more