From 87e9c3991a862abac2a801a76a96173e2ddf95f6 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 2 Apr 2025 07:35:00 -0400 Subject: [PATCH] rbutil: Update tarball scripts Change-Id: I33a42fc2535ddead1780bbceb2c4c048a3aba8de --- utils/common/gitscraper.py | 9 +++++++-- utils/common/tarball-rbutil.py | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/utils/common/gitscraper.py b/utils/common/gitscraper.py index 8d162155d9..b483c1fd45 100755 --- a/utils/common/gitscraper.py +++ b/utils/common/gitscraper.py @@ -206,7 +206,7 @@ def scrape_files(repo, treehash, filelist, dest=None, timestamp_files=None): def archive_files(repo, treehash, filelist, basename, tmpfolder=None, - archive="tbz"): + archive="txz"): '''Archive list of files into tarball. @param repo Path to repository root. @param treehash Hash identifying the tree. @@ -216,7 +216,7 @@ def archive_files(repo, treehash, filelist, basename, tmpfolder=None, basename inside of the archive as well (i.e. no tarbomb). @param tmpfolder Folder to put intermediate files in. If no folder is given a temporary one will get used. - @param archive Type of archive to create. Supported values are "tbz" and + @param archive Type of archive to create. Supported values are "txz", "tbz", and "7z". The latter requires the 7z binary available in the system's path. @return Output filename. @@ -243,6 +243,11 @@ def archive_files(repo, treehash, filelist, basename, tmpfolder=None, tf = tarfile.open(outfile, "w:bz2") tf.add(workfolder, basename) tf.close() + elif archive == "txz": + outfile = basename + ".tar.xz" + tf = tarfile.open(outfile, "w:xz") + tf.add(workfolder, basename) + tf.close() else: print("Files not archived") if tmpfolder != workfolder: diff --git a/utils/common/tarball-rbutil.py b/utils/common/tarball-rbutil.py index ccc413ca59..f51a7af82c 100755 --- a/utils/common/tarball-rbutil.py +++ b/utils/common/tarball-rbutil.py @@ -58,7 +58,9 @@ filelist = ["utils/rbutilqt", "utils/imxtools", "utils/nwztools", "utils/tomcrypt", + "utils/themeeditor", "lib/rbcodec/codecs/libspeex", + "lib/skin_parser", "docs/COPYING", "docs/gpl-2.0.html", "docs/logo/rockbox-clef.svg", @@ -80,6 +82,6 @@ filelist = ["utils/rbutilqt", "tools/sapi_voice.vbs"] print(f"Getting git revision {tree}") -gitscraper.archive_files(repository, tree, filelist, basename, archive="tbz") +gitscraper.archive_files(repository, tree, filelist, basename, archive="txz") -print(f"Created {basename}.tar.bz2.") +print(f"Created {basename}.tar.xz.")