Loading

Paste #pefxuwum1

  1. #!/bin/sh
  2. set -e -u -x
  3.  
  4. if test $# -ne 2
  5. then echo "repack_devzone <archive> <extension>"
  6.      exit 1
  7. fi
  8.  
  9. arch=$1
  10. ext=$2
  11.  
  12. if test `basename $arch .zip`.zip == $arch
  13. then echo "zippie"
  14.     unzip -x $arch
  15.     arch=`basename $arch .zip`
  16. fi
  17.  
  18. if test `basename $arch .tar`.tar != $arch
  19. then echo "no TAR!"
  20.      exit 1
  21. fi
  22.  
  23. tar xf $arch
  24. base=`basename $arch .tar`
  25. if test ! -d $base
  26. then echo "No unpacked basename!"
  27.      exit 1
  28. fi
  29.  
  30. mv $base $base-$ext
  31. tar cf $base-$ext.tar $base-$ext
  32.  
  33. echo " rm -r $base-$ext $arch $1"
  34. echo " mv $base-$ext.tar $HOME/.openttd/newgrf"

Comments