Skip to content

Commit

Permalink
Merge branch 'master' into rm_rpm_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Jul 3, 2023
2 parents 765809c + d3a3550 commit e3479d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `RPMBuilder` is renamed to `PackageBuilder`.
- The `PackageBuilder::build_time` method is removed. Package build time is now
included by default and can be clamped using the `PackageBuilder::source_date` method.
- Several of the signer and verifier trait APIs were changed

## Added

- `PackageBuilder::source_date` method for clamping modification time of files,
build time of the package, and signature time. This functionality is required for
reproducible generation of packages.
- `Package::sign_with_timestamp` method.
- Package build time is now included by default.
- The "rpmversion" tag is now populated so that packages know which library (and version)
they were built with.

### Changed

- Build time metadata is now included in the built package by default

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bitflags = "2"
thiserror = "1"
nom = "7"
num-traits = "0.2"
num-derive = "0.3"
num-derive = "0.4"
num = "0.4"
enum-primitive-derive = "0.2"
enum-display-derive = "0.1"
Expand All @@ -49,7 +49,7 @@ sha1 = "0.10"
pgp = { version = "0.10", optional = true }
chrono = { version = "0.4", optional = true }
log = "0.4"
itertools = "0.10"
itertools = "0.11"
hex = { version = "0.4", features = ["std"] }
zstd = "0.12"
xz2 = "0.1"
Expand Down
6 changes: 5 additions & 1 deletion src/rpm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,11 @@ impl PackageBuilder {
offset,
IndexData::Int32(vec![self.epoch]),
),
// @todo: write RPMTAG_RPMVERSION?
IndexEntry::new(
IndexTag::RPMTAG_RPMVERSION,
offset,
IndexData::StringTag(format!("rpm-rs {}", env!("CARGO_PKG_VERSION"))),
),
// @todo: write RPMTAG_PLATFORM?
IndexEntry::new(
IndexTag::RPMTAG_VERSION,
Expand Down
4 changes: 2 additions & 2 deletions src/rpm/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ impl Package {
}

/// Create package signatures using an external key and provided timestamp.
/// Adds geenrated signatures to the signature header.
/// Adds generated signatures to the signature header.
///
/// This method is usually used for reproducible builds, otherwise you should
/// prefer using the [`sign`][Package::sign] method instead.
///
/// # Examples
/// ```
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let mut package = rpm::Package::open("test_assets/monkeysphere-0.37-1.el7.noarch.rpm")?;
/// let mut package = rpm::RPMPackage::open("test_assets/ima_signed.rpm")?;
/// let raw_secret_key = std::fs::read("./test_assets/secret_key.asc")?;
/// let signer = rpm::signature::pgp::Signer::load_from_asc_bytes(&raw_secret_key)?;
/// // It's recommended to use timestamp of last commit in your VCS
Expand Down

0 comments on commit e3479d1

Please sign in to comment.