@@ -14,9 +14,10 @@ object Archives {
14
14
* @param name of output (without extension)
15
15
* @param mappings included in the output
16
16
* @param top level directory
17
+ * @param options NOT USED
17
18
* @return zip file
18
19
*/
19
- def makeZip (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ]): File = {
20
+ def makeZip (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ], options : Seq [ String ] ): File = {
20
21
val zip = target / (name + " .zip" )
21
22
22
23
// add top level directory if defined
@@ -35,9 +36,10 @@ object Archives {
35
36
* @param name of output (without extension)
36
37
* @param mappings included in the output
37
38
* @param top level directory
39
+ * @param options NOT USED
38
40
* @return zip file
39
41
*/
40
- def makeNativeZip (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ]): File = {
42
+ def makeNativeZip (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ], options : Seq [ String ] ): File = {
41
43
val zip = target / (name + " .zip" )
42
44
43
45
// add top level directory if defined
@@ -58,9 +60,10 @@ object Archives {
58
60
* @param name of output (without extension)
59
61
* @param mappings included in the output
60
62
* @param top level directory : NOT USED
63
+ * @param options NOT USED
61
64
* @return dmg file
62
65
*/
63
- def makeDmg (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ]): File = {
66
+ def makeDmg (target : File , name : String , mappings : Seq [(File , String )], top : Option [String ], options : Seq [ String ] ): File = {
64
67
val t = target / " dmg"
65
68
val dmg = target / (name + " .dmg" )
66
69
if (! t.isDirectory) IO .createDirectory(t)
@@ -139,20 +142,21 @@ object Archives {
139
142
}
140
143
file(f.getAbsolutePath + " .xz" )
141
144
}
145
+
142
146
val makeTxz = makeTarball(xz, " .txz" ) _
143
147
val makeTgz = makeTarball(gzip, " .tgz" ) _
144
- val makeTar = makeTarball(identity, " .tar" ) _
145
148
146
149
/**
147
150
* Helper method used to construct tar-related compression functions.
148
151
* @param target folder to build package in
149
152
* @param name of output (without extension)
150
153
* @param mappings included in the output
151
154
* @param top level directory
155
+ * @param options for tar command
152
156
* @return tar file
153
157
*
154
158
*/
155
- def makeTarball (compressor : File => File , ext : String )(target : File , name : String , mappings : Seq [(File , String )], top : Option [String ]): File = {
159
+ def makeTarball (compressor : File => File , ext : String )(target : File , name : String , mappings : Seq [(File , String )], top : Option [String ], options : Seq [ String ] ): File = {
156
160
val relname = name
157
161
val tarball = target / (name + ext)
158
162
IO .withTemporaryDirectory { f =>
@@ -179,7 +183,9 @@ object Archives {
179
183
180
184
val tmptar = f / (relname + " .tar" )
181
185
182
- Process (Seq (" tar" , " --force-local" , " -pcvf" , tmptar.getAbsolutePath) ++ distdirs, Some (rdir)).! match {
186
+ val cmd = Seq (" tar" ) ++ options ++ Seq (tmptar.getAbsolutePath) ++ distdirs
187
+ println(" Running with " + cmd.mkString(" " ))
188
+ Process (cmd, Some (rdir)).! match {
183
189
case 0 => ()
184
190
case n => sys.error(" Error tarballing " + tarball + " . Exit code: " + n)
185
191
}
0 commit comments