pack.sh 571 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. PROG_NAME="PROG_NAME"
  3. ### Web
  4. #zip -r -9 web.zip web
  5. ### Linux
  6. TAR_FLAGS="
  7. --sort=name --format=posix
  8. --pax-option=exthdr.name=%d/PaxHeaders/%f
  9. --pax-option=delete=atime,delete=ctime,delete=mtime
  10. --mtime=@0
  11. --numeric-owner --owner=0 --group=0
  12. --mode=go+u,go-w
  13. --no-acls --no-selinux --no-xattrs
  14. "
  15. for filename in linux/*.zip; do
  16. tmp_path="/tmp/$PROG_NAME/${filename%.*}"
  17. mkdir -p $tmp_path
  18. unzip $filename -d $tmp_path
  19. #rm -f $filename
  20. tar $TAR_FLAGS -I "zstd -19" -cf "${filename%.*}.tar.zst" -C $tmp_path .
  21. rm -r $tmp_path
  22. done