Skip to content

Commit

Permalink
Issue 1382: Detect config files regardless of execute permission (#1383)
Browse files Browse the repository at this point in the history
Co-authored-by: Nepomuk Seiler <[email protected]>
  • Loading branch information
SalehDehqanpour and muuki88 authored Dec 17, 2020
1 parent 3f57c72 commit dbc85c4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,17 @@ object LinuxPlugin extends AutoPlugin {
rename: String => String
): Seq[LinuxPackageMapping] = {
val (directories, nondirectories) = mappings.partition(_._1.isDirectory)
val (binaries, nonbinaries) = nondirectories.partition(_._1.canExecute)
val (manPages, nonManPages) = nonbinaries partition {
val (configFiles, nonConfigFiles) = nondirectories partition {
case (_, destination) => (destination contains "etc/") || (destination contains "conf/")
}
val (binaries, nonbinaries) = nonConfigFiles.partition(_._1.canExecute)
val (manPages, remaining) = nonbinaries partition {
case (_, destination) => (destination contains "man/") && (destination endsWith ".1")
}
val compressedManPages =
for ((file, name) <- manPages)
yield file -> (name + ".gz")
val (configFiles, remaining) = nonManPages partition {
case (_, destination) => (destination contains "etc/") || (destination contains "conf/")
}

def packageMappingWithRename(mappings: (File, String)*): LinuxPackageMapping = {
val renamed =
for ((file, name) <- mappings)
Expand Down

0 comments on commit dbc85c4

Please sign in to comment.