#!/bin/bash

if [ "$1" == 0 ]
then
echo "need to specify location of launchpad-exports.tar.gz"
exit 0
fi

origdir=$(pwd)

cd ../../po
tpofiles=$(tar -ztf $1 | grep "\.po$")
for x in $tpofiles
do
tar -zxf $1 $x --to-stdout > $(echo $x | sed "s/unetbootin-/\n/" | tail -n 1)
done

cd $origdir
./mktsfiles
./mkpotfile
