create_sha_list.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # Create SHA1/SHA256 list of binary files from packages/* and install.sh
  3. #
  4. # You can test SHA1/SHA256 by using 'sha1sum -c sha-file' or 'sha256sum -c sha-file'
  5. case x$1 in
  6. x|x-h)
  7. echo "Usage: $0 [options] > output_file
  8. Options:
  9. -h: help
  10. -a: show all SHA1/SHA256
  11. Create SHA1/SHA256 list of binary files from packages/*.rb files and install.sh.
  12. It is possible to check SHA1/SHA256 by using 'sha1sum -c file' or 'sha256sum -c file'"
  13. exit 0;;
  14. x-a)
  15. ;;
  16. esac
  17. grep -h '\(link=\|sha256=\)' install.sh |
  18. sed -e 's/link=//' \
  19. -e 's/sha256=//'\
  20. -e 's/^[ \t]*["'"'"']//' \
  21. -e 's/[\?&].*["'"'"'].*$//' \
  22. -e 's/["'"'"'].*$//' \
  23. -e 's/\(http\|https\|ftp\):.*\///' | \
  24. sed -ne 'N;s/\(.*\)\n\(.*\)/\2 \1/;p'
  25. for f in packages/*.rb; do
  26. grep -h '\(armv7l\|i686\|x86_64\):' $f | \
  27. sort | \
  28. sed -e 's:/www\.dropbox\.com/:/dl.dropboxusercontent.com/:' \
  29. -e 's/\(armv7l\|i686\|x86_64\)://' \
  30. -e 's/^[ \t]*["'"'"']//' \
  31. -e 's/[\?&].*["'"'"'].*$//' \
  32. -e 's/["'"'"'].*$//' \
  33. -e 's/\(http\|https\|ftp\):.*\///' | \
  34. sed -ne 'N;s/\n/ /;p'
  35. done