Skip to content

Commit bcc8bed

Browse files
Travis CITy Coghlan
Travis CI
authored and
Ty Coghlan
committed
sbt#1178 attempt at adding in rpm epochs
1 parent 596eb92 commit bcc8bed

File tree

8 files changed

+36
-3
lines changed

8 files changed

+36
-3
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Change Log
22

3+
## [Unreleased](https://github.com/sbt/sbt-native-packager/tree/HEAD)
4+
5+
[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.15...HEAD)
6+
7+
**Closed issues:**
8+
9+
- WindowsPlugin: support multiple .wxs inputs [\#1176](https://github.com/sbt/sbt-native-packager/issues/1176)
10+
11+
## [v1.3.15](https://github.com/sbt/sbt-native-packager/tree/v1.3.15) (2018-11-29)
12+
[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.14...v1.3.15)
13+
14+
**Merged pull requests:**
15+
16+
- WindowsPlugin: support multiple wxs sources \(\#1176\) [\#1177](https://github.com/sbt/sbt-native-packager/pull/1177) ([nigredo-tori](https://github.com/nigredo-tori))
17+
318
## [v1.3.14](https://github.com/sbt/sbt-native-packager/tree/v1.3.14) (2018-11-21)
419
[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.12...v1.3.14)
520

integration-tests-ansible/test-project-play-rpm/packaging.sbt

+2
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ rpmRelease := "1"
2828
rpmVendor := "DemoVendor"
2929

3030
rpmLicense := Some("Apache-2.0")
31+
32+
rpmEpoch := 1

integration-tests-ansible/test-project-play-rpm/run-test-playbook.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
set -euo pipefail
55
IFS=$'\n\t'
66

7-
ansible-playbook --private-key=.vagrant/machines/default/virtualbox/private_key --user=vagrant --connection=ssh --limit='default' --inventory-file=.vagrant/provisioners/ansible/inventory provisioning/test.yml
7+
ansible-playbook-3 --private-key=.vagrant/machines/default/virtualbox/private_key --user=vagrant --connection=ssh --limit='default' --inventory-file=.vagrant/provisioners/ansible/inventory provisioning/test.yml

src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ trait RpmKeys {
2121
// DESCRIPTION KEYS
2222
// TODO - Summary and license are required.
2323
val rpmLicense = SettingKey[Option[String]]("rpm-license", "License of the code within the RPM.")
24+
val rpmEpoch = SettingKey[Int]("rpm-epoch", "Epoch of the generated RPM.")
2425
val rpmDistribution = SettingKey[Option[String]]("rpm-distribution")
2526
val rpmUrl =
2627
SettingKey[Option[String]]("rpm-url", "Url to include in the RPM.")

src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ case class RpmMetadata(name: String,
1818
summary: String,
1919
description: String,
2020
autoprov: String,
21-
autoreq: String)
21+
autoreq: String,
22+
epoch: Int)
2223

2324
/**
2425
* The Description used to generate an RPM
@@ -222,6 +223,9 @@ case class RpmSpec(meta: RpmMetadata,
222223
sb append ("Version: %s\n" format meta.version)
223224
sb append ("Release: %s\n" format meta.release)
224225
sb append ("Summary: %s\n" format meta.summary)
226+
227+
if (meta.epoch > 0) sb append ("Epoch: %d\n" format meta.epoch)
228+
225229
meta.prefix foreach { v =>
226230
sb append ("prefix: %s\n" format v)
227231
}

src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ object RpmPlugin extends AutoPlugin {
6969
rpmPrefix := None,
7070
rpmVendor := "", // TODO - Maybe pull in organization?
7171
rpmLicense := None,
72+
rpmEpoch := 0,
7273
rpmDistribution := None,
7374
rpmUrl := None,
7475
rpmGroup := None,
@@ -121,7 +122,8 @@ object RpmPlugin extends AutoPlugin {
121122
(packageSummary in Rpm).value,
122123
(packageDescription in Rpm).value,
123124
rpmAutoprov.value,
124-
rpmAutoreq.value
125+
rpmAutoreq.value,
126+
rpmEpoch.value
125127
),
126128
rpmDescription := RpmDescription(
127129
rpmLicense.value,

src/sbt-test/rpm/simple-rpm/build.sbt

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager")
2121

2222
rpmLicense := Some("BSD")
2323

24+
rpmEpoch := 1
25+
2426
packageArchitecture in Rpm := "x86_64"
2527

2628
linuxPackageMappings in Rpm := {
@@ -38,6 +40,7 @@ TaskKey[Unit]("checkSpecFile") := {
3840
assert(spec contains "Release: 1", "Contains project release")
3941
assert(spec contains "Summary: Test rpm package", "Contains project summary")
4042
assert(spec contains "License: BSD", "Contains project license")
43+
assert(spec contains "Epoch: 1", "Contains epoch of 1")
4144
assert(spec contains "Vendor: typesafe", "Contains project vendor")
4245
assert(spec contains "URL: http://github.com/sbt/sbt-native-packager", "Contains project url")
4346
assert(spec contains "BuildArch: x86_64", "Contains project package architecture")

src/sphinx/formats/rpm.rst

+6
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ Informational Settings
123123
``rpmLicense``
124124
The license associated with software in the RPM.
125125

126+
``rpmEpoch``
127+
The epoch is the most significant number used when resolving different versions
128+
for the same RPM. For a given package, packages with the highest epoch will be
129+
used, and in the event of a tie it will fall back to comparing the version and
130+
release.
131+
126132
Dependency Settings
127133
~~~~~~~~~~~~~~~~~~~
128134

0 commit comments

Comments
 (0)