瀏覽代碼

scripts/dl_github_archive: add support for packing zstd archive

Add support for packing .zst archive when creating Github mirror tar.

Signed-off-by: Christian Marangi <[email protected]>
Christian Marangi 1 年之前
父節點
當前提交
c922c78094
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      scripts/dl_github_archive.py

+ 5 - 1
scripts/dl_github_archive.py

@@ -138,7 +138,11 @@ class Path(object):
         envs = os.environ.copy()
         if ts is not None:
             args.append('--mtime=@%d' % ts)
-        if into.endswith('.xz'):
+        if into.endswith('.zst'):
+            envs['ZSTD_CLEVEL'] = '20'
+            envs['ZSTD_NBTHREADS'] = '0'
+            args.append('--zstd')
+        elif into.endswith('.xz'):
             envs['XZ_OPT'] = '-7e'
             args.append('-J')
         elif into.endswith('.bz2'):