Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation and add a few small features and fixes #210

Merged
merged 11 commits into from
Jan 9, 2024
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:

test-feature-matrix:
name: Test Suite (feature-matrix)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
Expand All @@ -63,6 +62,11 @@ jobs:
flags:
- "--all-features"
- "--no-default-features"
os:
- "ubuntu-latest"
- "macos-latest"
# - "windows-latest" TODO
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Breaking Changes

- `Dependency::rpmlib()` now inserts the `rpmlib()` portion automatically, only the feature name itself should
be provided in the string passed as the name argument.
- `FileOptions::is_no_replace()` is now `FileOptions::is_config_noreplace()` to reflect the fact that the noreplace
flag is only applicable to config files, and have more similar usage relative to `%config(noreplace)`

### Added

- `Dependency::script_pre()`, `Dependency::script_post()`, `Dependency::script_preun()`, `Dependency::script_postun()`
- `Dependency::config()`, `Dependency::user()`, `Dependency::group()`
- `PackageBuilder::verify_script()`
- `PackageBuilder::group()` and `PackageBuilder::packager()`
- Added support for the automatic user/group creation feature in rpm 4.19

### Changed

- Improved documentation

### Fixed

- Using file capabilities now adds the appropriate rpmlib() dependency

## 0.13.1

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rpm"
version = "0.13.0"
version = "0.13.1"
authors = [
"René Richter <[email protected]>",
"Bernhard Schuster <[email protected]>",
Expand Down
26 changes: 4 additions & 22 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,30 +509,20 @@ bitflags! {
const TRIGGERPREIN = 1 << 25; // %triggerprein dependency
const KEYRING = 1 << 26;
// bit 27 unused
const CONFIG = 1 << 28;
const CONFIG = 1 << 28; // config() dependency
const META = 1 << 29; // meta dependency
}
}

bitflags! {
/// Flags to configure scriptlet execution,
///
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub struct ScriptletFlags: u32 {
/// Macro expansion,
///
/// Corresponds to RPMSCRIPT_FLAG_EXPAND
///
/// Macro expansion
const EXPAND = 1;
/// Header queryformat expansion,
///
/// Corresponds to RPMSCRIPT_FLAG_QFORMAT
///
/// Header queryformat expansion
const QFORMAT = 1 << 1;
/// Critical for success/failure,
///
/// Corresponds to RPMSCRIPT_FLAG_CRITICAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no rpm spec, I find it helpful to have references to the C code names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want super direct references to the RPM source code if it can be helped

///
/// Critical for success/failure
const CRITICAL = 1 << 2;
}
}
Expand Down Expand Up @@ -593,63 +583,55 @@ pub enum DigestAlgorithm {
}

/// Index tag values for the %prein scriptlet,
///
pub(crate) const PREIN_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_PREIN,
IndexTag::RPMTAG_PREINFLAGS,
IndexTag::RPMTAG_PREINPROG,
);

/// Index tag values for the %postin scriptlet,
///
pub(crate) const POSTIN_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_POSTIN,
IndexTag::RPMTAG_POSTINFLAGS,
IndexTag::RPMTAG_POSTINPROG,
);

/// Index tag values for the %preun scriptlet,
///
pub(crate) const PREUN_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_PREUN,
IndexTag::RPMTAG_PREUNFLAGS,
IndexTag::RPMTAG_PREUNPROG,
);

/// Index tag values for the %postun scriptlet,
///
pub(crate) const POSTUN_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_POSTUN,
IndexTag::RPMTAG_POSTUNFLAGS,
IndexTag::RPMTAG_POSTUNPROG,
);

/// Index tag values for the %pretrans scriptlet,
///
pub(crate) const PRETRANS_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_PRETRANS,
IndexTag::RPMTAG_PRETRANSFLAGS,
IndexTag::RPMTAG_PRETRANSPROG,
);

/// Index tag values for the %posttrans scriptlet,
///
pub(crate) const POSTTRANS_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_POSTTRANS,
IndexTag::RPMTAG_POSTTRANSFLAGS,
IndexTag::RPMTAG_POSTTRANSPROG,
);

/// Index tag values for the %preuntrans scriptlet,
///
pub(crate) const PREUNTRANS_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_PREUNTRANS,
IndexTag::RPMTAG_PREUNTRANSFLAGS,
IndexTag::RPMTAG_PREUNTRANSPROG,
);

/// Index tag values for the %postuntrans scriptlet,
///
pub(crate) const POSTUNTRANS_TAGS: ScriptletIndexTags = (
IndexTag::RPMTAG_POSTUNTRANS,
IndexTag::RPMTAG_POSTUNTRANSFLAGS,
Expand Down
Loading