From bcc8bed6afb3fc7acc057f0a39caa75040819e52 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Thu, 29 Nov 2018 12:42:30 +0000 Subject: [PATCH] #1178 attempt at adding in rpm epochs --- CHANGELOG.md | 15 +++++++++++++++ .../test-project-play-rpm/packaging.sbt | 2 ++ .../test-project-play-rpm/run-test-playbook.sh | 2 +- .../com/typesafe/sbt/packager/rpm/Keys.scala | 1 + .../typesafe/sbt/packager/rpm/RpmMetadata.scala | 6 +++++- .../com/typesafe/sbt/packager/rpm/RpmPlugin.scala | 4 +++- src/sbt-test/rpm/simple-rpm/build.sbt | 3 +++ src/sphinx/formats/rpm.rst | 6 ++++++ 8 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 285d45c18..35f4e2e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## [Unreleased](https://github.com/sbt/sbt-native-packager/tree/HEAD) + +[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.15...HEAD) + +**Closed issues:** + +- WindowsPlugin: support multiple .wxs inputs [\#1176](https://github.com/sbt/sbt-native-packager/issues/1176) + +## [v1.3.15](https://github.com/sbt/sbt-native-packager/tree/v1.3.15) (2018-11-29) +[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.14...v1.3.15) + +**Merged pull requests:** + +- WindowsPlugin: support multiple wxs sources \(\#1176\) [\#1177](https://github.com/sbt/sbt-native-packager/pull/1177) ([nigredo-tori](https://github.com/nigredo-tori)) + ## [v1.3.14](https://github.com/sbt/sbt-native-packager/tree/v1.3.14) (2018-11-21) [Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.12...v1.3.14) diff --git a/integration-tests-ansible/test-project-play-rpm/packaging.sbt b/integration-tests-ansible/test-project-play-rpm/packaging.sbt index 8211a4c1e..f19349907 100644 --- a/integration-tests-ansible/test-project-play-rpm/packaging.sbt +++ b/integration-tests-ansible/test-project-play-rpm/packaging.sbt @@ -28,3 +28,5 @@ rpmRelease := "1" rpmVendor := "DemoVendor" rpmLicense := Some("Apache-2.0") + +rpmEpoch := 1 diff --git a/integration-tests-ansible/test-project-play-rpm/run-test-playbook.sh b/integration-tests-ansible/test-project-play-rpm/run-test-playbook.sh index 2cc747263..bcc1a0bd3 100755 --- a/integration-tests-ansible/test-project-play-rpm/run-test-playbook.sh +++ b/integration-tests-ansible/test-project-play-rpm/run-test-playbook.sh @@ -4,4 +4,4 @@ set -euo pipefail IFS=$'\n\t' -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 +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 diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala index 0132ac94a..55b225f04 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala @@ -21,6 +21,7 @@ trait RpmKeys { // DESCRIPTION KEYS // TODO - Summary and license are required. val rpmLicense = SettingKey[Option[String]]("rpm-license", "License of the code within the RPM.") + val rpmEpoch = SettingKey[Int]("rpm-epoch", "Epoch of the generated RPM.") val rpmDistribution = SettingKey[Option[String]]("rpm-distribution") val rpmUrl = SettingKey[Option[String]]("rpm-url", "Url to include in the RPM.") diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala index 4480691f4..f1b5a93be 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala @@ -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 @@ -222,6 +223,9 @@ 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) + + if (meta.epoch > 0) sb append ("Epoch: %d\n" format meta.epoch) + meta.prefix foreach { v => sb append ("prefix: %s\n" format v) } diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala index 7b6ad8a2b..115a78083 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala @@ -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, @@ -121,7 +122,8 @@ object RpmPlugin extends AutoPlugin { (packageSummary in Rpm).value, (packageDescription in Rpm).value, rpmAutoprov.value, - rpmAutoreq.value + rpmAutoreq.value, + rpmEpoch.value ), rpmDescription := RpmDescription( rpmLicense.value, diff --git a/src/sbt-test/rpm/simple-rpm/build.sbt b/src/sbt-test/rpm/simple-rpm/build.sbt index 735e12740..41a7c3ecf 100644 --- a/src/sbt-test/rpm/simple-rpm/build.sbt +++ b/src/sbt-test/rpm/simple-rpm/build.sbt @@ -21,6 +21,8 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") +rpmEpoch := 1 + packageArchitecture in Rpm := "x86_64" linuxPackageMappings in Rpm := { @@ -38,6 +40,7 @@ TaskKey[Unit]("checkSpecFile") := { assert(spec contains "Release: 1", "Contains project release") assert(spec contains "Summary: Test rpm package", "Contains project summary") assert(spec contains "License: BSD", "Contains project license") + assert(spec contains "Epoch: 1", "Contains epoch of 1") assert(spec contains "Vendor: typesafe", "Contains project vendor") assert(spec contains "URL: http://github.com/sbt/sbt-native-packager", "Contains project url") assert(spec contains "BuildArch: x86_64", "Contains project package architecture") diff --git a/src/sphinx/formats/rpm.rst b/src/sphinx/formats/rpm.rst index c55818974..44c55c5f1 100644 --- a/src/sphinx/formats/rpm.rst +++ b/src/sphinx/formats/rpm.rst @@ -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 ~~~~~~~~~~~~~~~~~~~