Skip to content

Commit ce7cc54

Browse files
committed
Reinstate older methods which creates tar archive to preserve binary backward compatibility with 1.0.4
1 parent 6346ad4 commit ce7cc54

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala

+17-3
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,24 @@ object Archives {
192192
file(f.getAbsolutePath + ".xz")
193193
}
194194

195-
val makeTxz = makeTarball(xz, ".txz") _
196-
val makeTgz = makeTarball(gzip, ".tgz") _
195+
val makeTxz = makeTarballWithOptions(xz, ".txz") _
196+
val makeTgz = makeTarballWithOptions(gzip, ".tgz") _
197197

198198
/**
199+
* Helper method used to construct tar-related compression functions with `--force-local` and `-pvcf` option specified
200+
* as default.
201+
* @param target folder to build package in
202+
* @param name of output (without extension)
203+
* @param mappings included in the output
204+
* @param top level directory
205+
* @return tar file
206+
*
207+
*/
208+
def makeTarball(compressor: File => File, ext: String)(target: File, name: String, mappings: Seq[(File, String)], top: Option[String]): File =
209+
makeTarballWithOptions(compressor, ext)(target, name, mappings, top, options = Seq("--force-local", "-pcvf"))
210+
211+
212+
/**
199213
* Helper method used to construct tar-related compression functions.
200214
* @param target folder to build package in
201215
* @param name of output (without extension)
@@ -205,7 +219,7 @@ object Archives {
205219
* @return tar file
206220
*
207221
*/
208-
def makeTarball(compressor: File => File, ext: String)(target: File, name: String, mappings: Seq[(File, String)], top: Option[String], options: Seq[String]): File = {
222+
def makeTarballWithOptions(compressor: File => File, ext: String)(target: File, name: String, mappings: Seq[(File, String)], top: Option[String], options: Seq[String]): File = {
209223
val relname = name
210224
val tarball = target / (name + ext)
211225
IO.withTemporaryDirectory { f =>

0 commit comments

Comments
 (0)