hash_incrementals 807 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. [% IF c("var/sign_build") -%]
  3. # var/set_default_env will reset HOME. We need to restore it to use gpg.
  4. old_HOME="$HOME"
  5. [% END -%]
  6. [% c("var/set_default_env") -%]
  7. [% IF c("var/nightly") -%]
  8. cd [% shell_quote(path(dest_dir)) %]/[% c("version") %]
  9. [% ELSE -%]
  10. cd [% shell_quote(path(dest_dir)) %]/[% c("var/signed_status") %]/[% c("version") %]-[% c("var/torbrowser_build") %]
  11. [% END -%]
  12. if ls -1 | grep -q '\.incremental\.mar$'
  13. then
  14. sha256sum `ls -1 | grep '\.incremental\.mar$' | sort` > sha256sums-[% c("var/signed_status") %]-build.incrementals.txt
  15. else
  16. echo 'No incrementals were found' >&2
  17. exit 1
  18. fi
  19. [% IF c("var/sign_build") -%]
  20. export HOME="$old_HOME"
  21. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-[% c("var/signed_status") %]-build.incrementals.txt
  22. [% END -%]