ddmg.sh 902 B

12345678910111213141516171819202122
  1. [% SET src = c('dmg_src', { error_if_undef => 1 }) -%]
  2. find [% src %] -executable -exec chmod 0755 {} \;
  3. find [% src %] ! -executable -exec chmod 0644 {} \;
  4. find [% src %] -exec [% c("var/touch") %] {} \;
  5. dmg_tmpdir=\$(mktemp -d)
  6. [% SET filelist = '"\$dmg_tmpdir/filelist.txt"' %]
  7. pushd [% src %]
  8. find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > [% filelist %]
  9. find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> [% filelist %]
  10. export LD_PRELOAD=[% c("var/faketime_path") %]
  11. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  12. genisoimage -D -V "Tor Browser" -no-pad -R -apple -o "\$dmg_tmpdir/tbb-uncompressed.dmg" -path-list [% filelist %] -graft-points -gid 20 -dir-mode 0755 -new-dir-mode 0755
  13. dmg dmg "\$dmg_tmpdir/tbb-uncompressed.dmg" [% c('dmg_out', { error_if_undef => 1 }) %]
  14. popd
  15. rm -Rf "\$dmg_tmpdir"