1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/sh
BASEDIR=$1
OLD_IFS=$IFS
IFS="
"
script=""
tar_bz2=""
WAF="$BASEDIR/waf"
inputdata=`sed -e "s|\\\\x0|#0000|g" $WAF | sed -e "s|\\\\\\\\|#005c|g"`
is_script=1
for line in $inputdata
do
case $line in
\#==\>)
is_script=0
;;
\#\<==)
is_script=1
;;
*)
if test $is_script -eq 1; then
script=$script$line"\n"
else
tar_bz2=$line
fi
;;
esac
done
echo "$script" > "$BASEDIR/waf-uncompressed"
chmod +x "$BASEDIR/waf-uncompressed"
echo -n "$tar_bz2" | sed "s|^#||g" | sed "s|#\\/|\\n|g" | sed "s|#\\*|\\r|g" | sed "s|#0000|\\x0|g" | sed "s|#005c|\\\\|g" | \
tar -xjf - -C $BASEDIR
IFS=$OLD_IFS
|