122122 version::VersionNumber;
123123 platform::AbstractPlatform = HostPlatform(),
124124 verbose::Bool = false, force::Bool = false,
125- filter = Returns(true))
125+ filter = Returns(true),
126+ compression_format::String = "gzip",
127+ )
126128
127129Build a tarball of the `prefix`, storing the tarball at `output_base`, appending the version
128130number `version`, a platform-dependent suffix and a file extension. If `platform` is not
@@ -137,7 +139,8 @@ The are additional keyword arguments:
137139 should be packaged, and `false` otherwise. The arguments are `(prefix, path)`, where
138140 `prefix` is the directory where the prefix is stored, and `path` is the path, within the
139141 prefix, of the file or directory. This keyword allows you to filter out from the tarball
140- certain files or directories.
142+ certain files or directories
143+ * `compression_format` specifies the compression format used for the tarball.
141144"""
142145function package (prefix:: Prefix ,
143146 output_base:: AbstractString ,
@@ -146,9 +149,19 @@ function package(prefix::Prefix,
146149 verbose:: Bool = false ,
147150 force:: Bool = false ,
148151 filter = Returns (true ),
152+ compression_format:: String = " gzip" ,
149153 )
150154 # Calculate output path
151- out_path = " $(output_base) .v$(version) .$(triplet (platform)) .tar.gz"
155+ extension = if compression_format == " gzip"
156+ " gz"
157+ elseif compression_format == " xz"
158+ " xz"
159+ elseif compression_format == " bzip2"
160+ " bz2"
161+ else
162+ error (" Unsupported compression format $(compression_format) " )
163+ end
164+ out_path = " $(output_base) .v$(version) .$(triplet (platform)) .tar.$(extension) "
152165
153166 if isfile (out_path)
154167 if force
0 commit comments