Skip to content

Commit

Permalink
Add rpmlib() feature flag for packages with caps
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Dec 30, 2023
1 parent 3602f55 commit 2693e5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/rpm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2693e5a

Please sign in to comment.