summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-01-15 14:33:56 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-18 14:44:22 +0100
commit93a2da54a5c03c08dc2d9d0efda8da216643af65 (patch)
tree058842495ae5f0ac24b2d63ecfb66e8dd88fdf04 /src
parent0a3c5e2931f261b4476b1ab716755a356252a423 (diff)
Add a "meta" field for the Package struct
This field may be used by the packager to define meta information on a package and later use that meta-information in their packaging scripts. For example: meta.description = "A simple package" and later use that to write a RPM spec file: echo "Description: {{this.meta.description}}" >> specfile Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src')
-rw-r--r--src/package/package.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/package/package.rs b/src/package/package.rs
index 6991d96..917b6a0 100644
--- a/src/package/package.rs
+++ b/src/package/package.rs
@@ -64,6 +64,15 @@ pub struct Package {
#[getset(get = "pub")]
phases: HashMap<PhaseName, Phase>,
+
+ /// Meta field
+ ///
+ /// Contains only key-value string-string data, that the packager can set for a package and
+ /// then use in the packaging scripts (for example) to write package meta data to the package
+ /// file (think of rpmbuild spec files).
+ #[getset(get = "pub")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ meta: Option<HashMap<String, String>>,
}
impl Package {
@@ -82,6 +91,7 @@ impl Package {
allowed_images: None,
denied_images: None,
phases: HashMap::new(),
+ meta: None,
}
}