From 2693e5a654071852fc530d8715fdcde7e99d0fff Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Fri, 22 Dec 2023 11:16:53 -0500 Subject: [PATCH] Add rpmlib() feature flag for packages with caps --- CHANGELOG.md | 4 ++++ src/rpm/builder.rs | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b91b8a98..0c93ffb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- `Dependency::script_pre()`, `Dependency::script_post()`, `Dependency::script_preun()`, `Dependency::script_postun()` + ## 0.13.1 ### Added diff --git a/src/rpm/builder.rs b/src/rpm/builder.rs index 1646b921..9a49a17f 100644 --- a/src/rpm/builder.rs +++ b/src/rpm/builder.rs @@ -665,9 +665,13 @@ impl PackageBuilder { let mut base_names = Vec::with_capacity(files_len); let mut combined_file_sizes: u64 = 0; + let mut uses_file_capabilities = false; for (cpio_path, entry) in self.files.iter() { combined_file_sizes += entry.size; + if entry.caps.is_some() { + uses_file_capabilities = true; + } file_sizes.push(entry.size); file_modes.push(entry.mode.into()); file_caps.push(entry.caps.to_owned()); @@ -742,6 +746,13 @@ impl PackageBuilder { )); } + if uses_file_capabilities { + self.requires.push(Dependency::rpmlib( + "rpmlib(FileCaps)".to_owned(), + "4.6.1-1".to_owned(), + )); + } + let mut provide_names = Vec::new(); let mut provide_flags = Vec::new(); let mut provide_versions = Vec::new();