From f6e3163904905721e136f3bbd420dd2683dd9ab3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 29 Dec 2016 16:46:46 +0100 Subject: [PATCH] add script to unconvert back into pk3 --- uncompress_squashfs.pk3 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 uncompress_squashfs.pk3 diff --git a/uncompress_squashfs.pk3 b/uncompress_squashfs.pk3 new file mode 100755 index 00000000..d3c33ab5 --- /dev/null +++ b/uncompress_squashfs.pk3 @@ -0,0 +1,23 @@ +#!/bin/bash +inputPK3=$1 + +echo "Extracting" +unsquashfs -d extractDir ${inputPK3} +cd extractDir + +#$FLIF needs to point towards the flif binary + +echo "Converting" +for file in `find . | grep "\.flif"`; do # in theory we could make this parallel + $FLIF -e ${file} "${file%.flif}.png" # flif -> png + convert "${file%.flif}.png" "${file%.flif}.tga" # png -> tga + rm $file # rm flif + rm ${file%.flif}.png # rm png +done + +echo "Compressing" +cd .. +echo `pwd` +zip -9 -r ${inputPK3%.sqfs}.pk3 extractDir/* + +rm -r extractDir # clean up -- 2.39.2