save-archive.sh 605 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # Part of Zombie Navigator
  3. # Copyright © 2015 Zombie Navigator Developers
  4. mylog () {
  5. echo "[`date`] $@" >&2
  6. }
  7. dir="`dirname "$0"`"
  8. dir="`cd "$dir"; cd .. ; pwd`"
  9. cd "$dir"
  10. . ./version_info
  11. archivesDir="archives"
  12. targetDir="$archivesDir/${addon_id}_`date +%s`"
  13. mkdir -p "$targetDir"
  14. path="${targetDir}/${addon_id}-${addon_version}.tar.gz"
  15. ./tools/archive.sh "$@" > "$path"
  16. if which advdef >/dev/null 2>&1 ; then
  17. # AdvanceCOMP available
  18. mylog "Recompressing..."
  19. advdef -z -4 -i 200 "$path"
  20. else
  21. mylog "NOTE: Skipping recompression (AdvanceCOMP needed)..."
  22. fi
  23. # vim: ts=4 noet ai