Skip to content

Commit 2d525f8

Browse files
committed
fix regression where .deb ended up with wrong name on server
this happened when we upgraded sbt-native-packager from 0.6.x to 1.0.x; the new version calculates this differently
1 parent ad2eec8 commit 2d525f8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

project/ScalaDist.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ object ScalaDist {
4040
mappings in upload += uploadMapping(packageZipTarball in UniversalDocs).value,
4141
mappings in upload += uploadMapping(packageXzTarball in UniversalDocs).value,
4242
mappings in upload += uploadMapping(packageBin in Rpm).value,
43-
mappings in upload += uploadMapping(packageBin in Debian).value
43+
// Debian needs special handling because the value sbt-native-packager
44+
// gives us for `packageBin in Debian` (coming from the archiveFilename
45+
// method) includes the debian version and arch information,
46+
// which we historically have not included. I don't see a way to
47+
// override the filename on disk, so we re-map at upload time
48+
mappings in upload += Def.task {
49+
(packageBin in Debian).value ->
50+
s"scala/${version.value}/${(name in Debian).value}-${version.value}.deb"
51+
}.value
4452
)
4553

4654
def settings: Seq[Setting[_]] =

project/Unix.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ object Unix {
9393

9494
linuxPackageMappings in Debian += (packageMapping(
9595
(sourceDirectory.value / "debian" / "changelog") -> "/usr/share/doc/scala/changelog.gz"
96-
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs(),
97-
98-
// Hack so we use regular version, rather than debian version.
99-
target in Debian := target.value / s"${(name in Debian).value}-${version.value}"
96+
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
10097

10198
)
10299
}

0 commit comments

Comments
 (0)