File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ def _extract_archive(self, rebuild: bool) -> bool:
213
213
self .builds [self .target ] = os .path .join (
214
214
self .work_dir , self .target , f"{ self .archive [:- len ('.zip' )]} "
215
215
)
216
+ elif self .archive .endswith (".tar.xz" ):
217
+ self .builds [self .target ] = os .path .join (
218
+ self .work_dir , self .target , f"{ self .archive [:- len ('.tar.xz' )]} "
219
+ )
216
220
else :
217
221
self .logger .error (
218
222
f"Unexpected archive extension. Currently only supports .tar.gz and .zip!"
@@ -258,6 +262,15 @@ def _extract_archive(self, rebuild: bool) -> bool:
258
262
zip_ref = zipfile .ZipFile (self .download_path , "r" )
259
263
zip_ref .extractall (os .path .join (self .work_dir , self .target ))
260
264
zip_ref .close ()
265
+ elif self .archive .endswith (".tar.xz" ):
266
+ # Un-tar
267
+ self .logger .info (
268
+ f"Extracting tarball archive { self .archive } to { self .builds [self .target ]} ..."
269
+ )
270
+
271
+ tar = tarfile .open (self .download_path , "r:xz" )
272
+ tar .extractall (os .path .join (self .work_dir , self .target ))
273
+ tar .close ()
261
274
262
275
return True
263
276
You can’t perform that action at this time.
0 commit comments