A script to repack PK3's

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

A script to repack PK3's

Postby Ed » Sat Aug 11, 2007 10:44 pm

In another thread it was suggested that a script was needed to repack and fix pk3's which are broken (http://forums.alientrap.local/viewtopic.php?p=22241#22241). This thread is intended as an attempt to put this into practice. If you have any suggestions, code or otherwise, just reply and I can edit them into this script here.

Currently all this does is extract and recompress a map, all the other functions need to be stuck in the middle.

Code: Select all
#!/bin/bash

# usage [scriptname] [file]

if test -f $1       # test that file exists
   then echo $1 found      # confirmation of file existence
else
   echo no file to optimise, exiting nicely.   # warn that file doesn't exist and exit
   exit
fi

unzip -oq $1 -d repack_$1   # Extract the file
echo $1 extracted to repack_$1

# Compress
cd repack_$1/

7za a -tzip -mfb258 -mpass15 ../$1

# Clear up the junk
rm -rf *
cd ../
rmdir repack_$1/
Ed
Forum addon
 
Posts: 1172
Joined: Wed Mar 01, 2006 12:32 am
Location: UK

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron