Skip to content

Commit 16e8ea9

Browse files
committed
Implementing permissions as described in #174
1 parent cc4719d commit 16e8ea9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala

+16-16
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ trait GenericPackageSettings
6767
defaultLinuxConfigLocation := "/etc",
6868

6969
// First we look at the src/linux files
70-
linuxPackageMappings <++= (sourceDirectory in Linux, daemonUser in Linux, daemonGroup in Linux) map { (dir, user, group) =>
71-
mapGenericMappingsToLinux(MappingsHelper contentOf dir, user, group)(identity)
70+
linuxPackageMappings <++= (sourceDirectory in Linux) map { dir =>
71+
mapGenericMappingsToLinux(MappingsHelper contentOf dir, Users.Root, Users.Root)(identity)
7272
},
7373
// Now we look at the src/universal files.
74-
linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation, daemonUser in Linux, daemonGroup in Linux) map {
75-
(pkg, mappings, installLocation, user, group) =>
74+
linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation) map {
75+
(pkg, mappings, installLocation) =>
7676
// TODO - More windows filters...
7777
def isWindowsFile(f: (File, String)): Boolean =
7878
f._2 endsWith ".bat"
7979

80-
mapGenericMappingsToLinux(mappings filterNot isWindowsFile, user, group) { name =>
80+
mapGenericMappingsToLinux(mappings filterNot isWindowsFile, Users.Root, Users.Root) { name =>
8181
installLocation + "/" + pkg + "/" + name
8282
}
8383
},
@@ -92,17 +92,17 @@ trait GenericPackageSettings
9292
},
9393
// Map configuration files
9494
linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation, defaultLinuxConfigLocation)
95-
map { (pkg, mappings, installLocation, configLocation) =>
96-
val needsConfLink =
97-
mappings exists {
98-
case (file, name) =>
99-
(name startsWith "conf/") && !file.isDirectory
100-
}
101-
if (needsConfLink) Seq(LinuxSymlink(
102-
link = configLocation + "/" + pkg,
103-
destination = installLocation + "/" + pkg + "/conf"))
104-
else Seq.empty
105-
})
95+
map { (pkg, mappings, installLocation, configLocation) =>
96+
val needsConfLink =
97+
mappings exists {
98+
case (file, name) =>
99+
(name startsWith "conf/") && !file.isDirectory
100+
}
101+
if (needsConfLink) Seq(LinuxSymlink(
102+
link = configLocation + "/" + pkg,
103+
destination = installLocation + "/" + pkg + "/conf"))
104+
else Seq.empty
105+
})
106106

107107
def mapGenericFilesToWindows: Seq[Setting[_]] = Seq(
108108
mappings in Windows <<= mappings in Universal,

0 commit comments

Comments
 (0)