forked from len0rd/rockbox
rbutil: Update tarball scripts
Change-Id: I33a42fc2535ddead1780bbceb2c4c048a3aba8de
This commit is contained in:
parent
25c345feac
commit
87e9c3991a
2 changed files with 11 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue