]> git.xonotic.org Git - xonotic/xonotic.git/blob - uncompress_squashfs.pk3
add script to unconvert back into pk3
[xonotic/xonotic.git] / uncompress_squashfs.pk3
1 #!/bin/bash
2 inputPK3=$1
3
4 echo "Extracting"
5 unsquashfs -d extractDir ${inputPK3}
6 cd extractDir
7
8 #$FLIF needs to point towards the flif binary 
9
10 echo "Converting"
11 for file in `find . | grep "\.flif"`; do # in theory we could make this parallel
12         $FLIF -e ${file} "${file%.flif}.png" # flif -> png
13         convert "${file%.flif}.png" "${file%.flif}.tga" # png -> tga
14         rm $file # rm flif
15         rm ${file%.flif}.png # rm png
16 done
17
18 echo "Compressing"
19 cd ..
20 echo `pwd`
21 zip -9 -r ${inputPK3%.sqfs}.pk3 extractDir/*
22
23 rm -r extractDir # clean up