diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala index 8948d5add..6d9cb4d77 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala @@ -41,7 +41,6 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { script } - private[this] def prependAndFixPerms(script: File, lines: Seq[String], perms: LinuxFileMetaData): File = { val old = IO.readLines(script) IO.writeLines(script, lines ++ old, append = false) @@ -49,14 +48,12 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { script } - private[this] def appendAndFixPerms(script: File, lines: Seq[String], perms: LinuxFileMetaData): File = { IO.writeLines(script, lines, append = true) chmod(script, perms.permissions) script } - private[this] def createFileIfRequired(script: File, perms: LinuxFileMetaData): File = { if (!script.exists()) { script.createNewFile() @@ -65,7 +62,6 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { script } - private[this] def scriptMapping(scriptName: String)(script: Option[File], controlDir: File): Seq[(File, String)] = { (script, controlDir) match { // check if user defined script exists @@ -85,7 +81,6 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { } } - def debianSettings: Seq[Setting[_]] = Seq( debianPriority := "optional", debianSection := "java", @@ -131,6 +126,11 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { }, debianControlFile <<= (debianPackageMetadata, debianPackageInstallSize, target) map { (data, size, dir) => + if (data.info.description == null || data.info.description.isEmpty) { + sys.error( + """packageDescription in Debian cannot be empty. Use + packageDescription in Debian := "My package Description"""") + } val cfile = dir / Names.Debian / Names.Control IO.write(cfile, data.makeContent(size), java.nio.charset.Charset.defaultCharset) chmod(cfile, "0644") @@ -208,8 +208,7 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin { val userGroupAdd = Seq( TemplateWriter.generateScript(DebianPlugin.postinstGroupaddTemplateSource, replacements), - TemplateWriter.generateScript(DebianPlugin.postinstUseraddTemplateSource, replacements) - ) + TemplateWriter.generateScript(DebianPlugin.postinstUseraddTemplateSource, replacements)) prependAndFixPerms(postinst, userGroupAdd, LinuxFileMetaData()) @@ -269,7 +268,6 @@ object DebianPlugin { val Conffiles = "conffiles" } - private def postinstGroupaddTemplateSource: java.net.URL = getClass.getResource("postinst-groupadd") private def postinstUseraddTemplateSource: java.net.URL = getClass.getResource("postinst-useradd") private def postinstChownTemplateSource: java.net.URL = getClass.getResource("postinst-chown")