Skip to content

Commit

Permalink
Merge pull request #117 from hindsightsoftware/postrm-exception
Browse files Browse the repository at this point in the history
debian:package-bin throws a FileNotFoundException for missing postrm
  • Loading branch information
jsuereth committed Jan 2, 2014
2 parents ec17055 + e81631e commit d9b49e7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin {
}


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 scriptMapping(scriptName: String)(script: Option[File], controlDir: File): Seq[(File, String)] = {
(script, controlDir) match {
// check if user defined script exists
Expand Down Expand Up @@ -186,7 +193,7 @@ trait DebianPlugin extends Plugin with linux.LinuxPlugin {
prependAndFixPerms(postinst, userGroupAdd, LinuxFileMetaData())

val purgeAdd = Seq(TemplateWriter.generateScript(DebianPlugin.postrmPurgeTemplateSource, replacements))
prependAndFixPerms(postrm, purgeAdd, LinuxFileMetaData())
appendAndFixPerms(postrm, purgeAdd, LinuxFileMetaData())
}
t
},
Expand Down

0 comments on commit d9b49e7

Please sign in to comment.