[openwrt/openwrt] scripts/dl_github_archive: add support for packing zstd archive

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 6 02:24:26 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c922c780946ae522237f970991300cdcda20a3a7

commit c922c780946ae522237f970991300cdcda20a3a7
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Mar 25 11:00:38 2024 +0100

    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 <ansuelsmth at gmail.com>
---
 scripts/dl_github_archive.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py
index 580b7cba38..744c441ca7 100755
--- a/scripts/dl_github_archive.py
+++ b/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'):




More information about the lede-commits mailing list