summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLopo2016-08-23 10:41:31 +0200
committerLopo2016-08-23 10:41:31 +0200
commit4c46bd333c841d464af3269215a56ee361fff5e5 (patch)
tree3c19caf46e6b03c0b97bf32117cdd00442414dc1 /PKGBUILD
parentb5bbc62bf79ef5bb90178a4a4235fd22ed993be9 (diff)
downloadaur-netbeans-php-nightly.tar.gz
fix for hash change
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD38
1 files changed, 26 insertions, 12 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 783a4200a97..e95e32e4a5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_bundle='php'
pkgname="netbeans-${_bundle}-nightly"
pkgver=latest
-pkgrel=9
+pkgrel=10
pkgdesc="Netbeans IDE for PHP"
license=('CDDL')
arch=('any')
@@ -30,19 +30,33 @@ prepare() {
_file="${_zipname}-${_bundle}.zip"
_md5=`grep "zip/${_file}" files.js \
| awk 'BEGIN {FPAT="\"[0-9a-z]+\""} {gsub(/\"/, "", $NF); print}'`
+ case ${#_md5} in
+ 32)
+ _alg=md5
+ ;;
+ 40)
+ _alg=sha1
+ ;;
+ 56)
+ _alg=sha224
+ ;;
+ 64)
+ _alg=sha256
+ ;;
+ 96)
+ _alg=sha384
+ ;;
+ 128)
+ _alg=sha512
+ ;;
+ *)
+ msg "unbale to detect hash algorithm, hash: ${_md5}"
+ return 1
+ ;;
+ esac
download_file "${_webroot}/zip/${_file}"
-
- msg "$(gettext "Validating source files with %s...")" "md5sums"
- file="$(get_filename "${_file}")"
- printf "%s" " $file ... " >&2
- local _realsum="$(openssl dgst -md5 "${_file}")"
- if [ "${_md5}" != "${_realsum##* }" ]; then
- printf -- "$(gettext "FAILED")\n" >&2
- return 1
- else
- printf -- "$(gettext "Passed")\n" >&2
- fi
+ verify_integrity_one "${_file}" ${_alg} "${_md5}" || return 1
cd "$srcdir"
ln -fs "${SRCDEST}/${_file}"