Skip to content

Commit

Permalink
sbt#1178 attempt at adding in rpm epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ophirr33 authored and Ty Coghlan committed Dec 10, 2018
1 parent 8038c04 commit 2fc2eae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions integration-tests-ansible/test-project-play-rpm/packaging.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ rpmRelease := "1"
rpmVendor := "DemoVendor"

rpmLicense := Some("Apache-2.0")

rpmEpoch := 1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ case class RpmMetadata(name: String,
summary: String,
description: String,
autoprov: String,
autoreq: String)
autoreq: String,
epoch: Int)

/**
* The Description used to generate an RPM
Expand Down Expand Up @@ -222,6 +223,7 @@ case class RpmSpec(meta: RpmMetadata,
sb append ("Version: %s\n" format meta.version)
sb append ("Release: %s\n" format meta.release)
sb append ("Summary: %s\n" format meta.summary)
sb append ("Epoch: %d\n" format meta.epoch)
meta.prefix foreach { v =>
sb append ("prefix: %s\n" format v)
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ object RpmPlugin extends AutoPlugin {
rpmPrefix := None,
rpmVendor := "", // TODO - Maybe pull in organization?
rpmLicense := None,
rpmEpoch := 0,
rpmDistribution := None,
rpmUrl := None,
rpmGroup := None,
Expand Down Expand Up @@ -121,7 +122,8 @@ object RpmPlugin extends AutoPlugin {
(packageSummary in Rpm).value,
(packageDescription in Rpm).value,
rpmAutoprov.value,
rpmAutoreq.value
rpmAutoreq.value,
rmpEpoch.value
),
rpmDescription := RpmDescription(
rpmLicense.value,
Expand Down
6 changes: 6 additions & 0 deletions src/sphinx/formats/rpm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ Informational Settings
``rpmLicense``
The license associated with software in the RPM.

``rpmEpoch``
The epoch is the most significant number used when resolving different versions
for the same RPM. For a given package, packages with the highest epoch will be
used, and in the event of a tie it will fall back to comparing the version and
release.

Dependency Settings
~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 2fc2eae

Please sign in to comment.