update_libreoffice 1.1 KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. version=3.3.0-rc4
  3. arches="x86 x86_64"
  4. outfile=/tmp/libreoffice.manifest
  5. for arch in $arches; do
  6. baseUrl=http://download.documentfoundation.org/libreoffice/testing/$version/rpm/$arch
  7. wget -qO- "$baseUrl" | grep -oP "LibO[^\"]+gz" | sort -u | while read -r file; do
  8. mirrors=`wget -qO- "$baseUrl/${file}.mirrorlist"`
  9. bytes=`echo "$mirrors" | grep -oP '\d+(?= bytes)'`
  10. sha256=`echo "$mirrors" | grep -oP '(?<=SHA-256 Hash</a>: <tt>)\w+(?=</tt>)'`
  11. sha1=`echo "$mirrors" | grep -oP '(?<=SHA-1 Hash</a>: <tt>)\w+(?=</tt>)'`
  12. [ -n "${bytes}" ] && [ -n "${sha256}" ] && [ -n "${sha1}" ] || { echo "failed to update data for {$file}"; exit 1; }
  13. echo "DIST ${file} ${bytes} SHA1 ${sha1} SHA256 ${sha256}" | tee -a $outfile || { echo "failed to write data to ${outfile}"; exit 1; }
  14. done
  15. done
  16. cp "$outfile" app-office/libreoffice-bin/Manifest || { echo "failed to replace manifest file. check if you are in overlay root and have necessary right."; exit 1; }
  17. echo "now execute something like:"
  18. echo "\$ ebuild app-office/libreoffice-bin/libreoffice-bin-${version/-/_}.ebuild digest"
  19. echo "if ebuild is already there or you know what to do."