Skip to content

Commit d334c80

Browse files
committed
Merge pull request #328 from kardapoltsev/wip/debian-archive-name
Fixed wrong archive name in jdeb packaging
2 parents 89b3db4 + d3de8f7 commit d334c80

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala

+9
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin with NativePackaging wi
252252
case (scr, _) => scr.toSeq.map(_ -> scriptName)
253253
}
254254
}
255+
256+
private[debian] def archiveFilename(appName: String, version: String, arch: String): String = {
257+
appName + "_" + version + "_" + arch + ".deb"
258+
}
259+
260+
private[debian] def changesFilename(appName: String, version: String, arch: String): String = {
261+
appName + "_" + version + "_" + arch + ".changes"
262+
}
263+
255264
}
256265

257266
/**

src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ trait JDebPackaging { this: DebianPlugin with linux.LinuxPlugin =>
3636
*/
3737
debianJDebPackaging <<= (debianExplodedPackage, linuxPackageMappings, linuxPackageSymlinks,
3838
debianControlFile, debianMaintainerScripts, debianConffilesFile,
39-
normalizedName, version, target, streams) map {
39+
normalizedName, version, packageArchitecture, target, streams) map {
4040
(_, mappings, symlinks, controlfile, controlscripts, conffile,
41-
name, version, target, s) =>
41+
name, version, arch, target, s) =>
4242
s.log.info("Building debian package with java based implementation 'jdeb'")
4343
val console = new JDebConsole(s.log)
44-
val debianFile = target.getParentFile / "%s_%s_all.deb".format(name, version)
44+
val archive = archiveFilename(name, version, arch)
45+
val debianFile = target.getParentFile / archive
4546
val debMaker = new DebMaker(console,
4647
fileAndDirectoryProducers(mappings, target) ++ linkProducers(symlinks),
4748
conffileProducers()

src/main/scala/com/typesafe/sbt/packager/debian/NativePackaging.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ trait NativePackaging { this: DebianPlugin with linux.LinuxPlugin =>
7070
(pkgdir, _, section, priority, name, version, arch, tdir, s) =>
7171
s.log.info("Building debian package with native implementation")
7272
// Make the package. We put this in fakeroot, so we can build the package with root owning files.
73-
val archive = name + "_" + version + "_" + arch + ".deb"
73+
val archive = archiveFilename(name, version, arch)
7474
Process(Seq("fakeroot", "--", "dpkg-deb", "--build", pkgdir.getAbsolutePath, "../" + archive), Some(tdir)) ! s.log match {
7575
case 0 => ()
7676
case x => sys.error("Failure packaging debian file. Exit code: " + x)

0 commit comments

Comments
 (0)