aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2018-05-14 23:34:12 +0200
committerEinhard Leichtfuß <alguien@respiranto.de>2018-05-14 23:34:12 +0200
commitef1f66602edc00757bae1b6d3dc9e187eda031f3 (patch)
tree5508eaa464eaf8dc34d383df690ef120031c7f91
parentdd809801e3c7a87d70e2b64bd028d1d3e386fa96 (diff)
Use the API to get the checksum
Since getting the checksum now does no longer take a considerable amount of time, put it in the ordinary handle_all() function. Also, remove repetitive clutter in the lines getting the information from the json file.
-rwxr-xr-xupdate.sh13
1 files changed, 4 insertions, 9 deletions
diff --git a/update.sh b/update.sh
index 31e0265..f2d7044 100755
--- a/update.sh
+++ b/update.sh
@@ -94,12 +94,6 @@ function update
lang_a="${long[${lang%-*}]}"
lang_b="${long[${lang#*-}]}"
- if [[ $src_type != vcs ]]
- then
- #checksum="$(wget -qO - "$url" | sha512sum | sed -E 's/\s*-$//')"
- checksum="$(wget -qO - "${url}.sha512" | cut -d ' ' -f 1)"
- fi
-
cp ../sample.PKGBUILD "$tmp"
replace '%LANG%' "$lang"
@@ -143,9 +137,10 @@ function handle_all
cd dict-freedict-${lang}${ext} || exit 1
$nopull || git pull -q
pkgver="$(grep pkgver .SRCINFO | sed -E 's/\s*pkgver\s*=\s*(.+)\s*/\1/')"
- ver="$(jq -r ".[] | select(.name == \"${lang}\") | .releases[] | select(.platform==\"$platform\") | .version" ../../freedict-database.json)"
- url="$(jq -r ".[] | select(.name == \"${lang}\") | .releases[] | select(.platform==\"$platform\") | .URL" ../../freedict-database.json)"
- url="${url%/download}"
+ data="$(jq -r ".[] | select(.name == \"${lang}\") | .releases[] | select(.platform==\"$platform\")" ../../freedict-database.json)"
+ ver="$(jq -r '.version' <<< "$data")"
+ url="$(jq -r '.URL' <<< "$data")"
+ checksum="$(jq -r '.checksum' <<< "$data")"
convver="${ver//-/_}"
if [[ "$pkgver" != "$convver" ]]