gwenhywfar: 4.20.0 -> 5.1.3

also update download url

Remove update script, because upstream has changed its CMS, which
changed the paths of the website, so the update script does not work any
more.
This commit is contained in:
Christian Lütke-Stetzkamp 2020-02-27 12:46:55 +01:00
parent b51d4e588d
commit e671d8d9c2
3 changed files with 5 additions and 102 deletions

View File

@ -16,12 +16,8 @@ in stdenv.mkDerivation rec {
pname = "gwenhywfar";
inherit version;
src = let
qstring = "package=01&release=${releaseId}&file=02";
mkURLs = map (base: "${base}/sites/download/download.php?${qstring}");
in fetchurl {
name = "${pname}-${version}.tar.gz";
urls = mkURLs [ "http://www.aquamaniac.de" "http://www2.aquamaniac.de" ];
src = fetchurl {
url = "https://www.aquamaniac.de/rdm/attachments/download/${releaseId}/${pname}-${version}.tar.gz";
inherit sha256;
};

View File

@ -1,8 +1,7 @@
# This file is autogenerated from update.sh in the same directory.
{
gwenhywfar.version = "4.20.0";
gwenhywfar.sha256 = "1c0g3f8jk6j693774ifslx2ds4ksabgbbalhhm9gk20kpamxm22s";
gwenhywfar.releaseId = "208";
gwenhywfar.version = "5.1.3";
gwenhywfar.sha256 = "0xjr9d94y46h7pfdhz5ygn01pmlm66rhiybr520h13nvjh4zid0r";
gwenhywfar.releaseId = "242";
libchipcard.version = "5.0.4";
libchipcard.sha256 = "0fj2h39ll4kiv28ch8qgzdbdbnzs8gl812qnm660bw89rynpjnnj";
libchipcard.releaseId = "200";

View File

@ -1,92 +0,0 @@
#!/bin/sh -e
basedir="$(cd "$(dirname "$0")" && pwd)"
getCurrentVersions() {
[ -e "$basedir/sources.nix" ] || return 0
(cd "$basedir" && nix-instantiate --eval --strict -E '
toString ((import ../../../../lib).mapAttrsToList
(name: info: "${name}:${info.version}!${info.sha256}!${info.releaseId}")
(import ./sources.nix))
' | tr -d '"')
}
currentVersions="$(getCurrentVersions)"
getLastestVersion() {
local baseurl="https://www.aquamaniac.de"
local pkglist="sites/download/packages.php?package=$1&showall=1"
local url="$baseurl/$pkglist"
local reVersion='[0-9]+(\.[0-9]+)+' # Only release versions, no betas!
local reHref='href=".*release=([0-9]+).*dummy=[^0-9]*('"$reVersion"')\.tar'
local reFull='s/^.*<a\>.*\<'"$reHref"'.*/\2!\1/p'
curl -s "$url" | sed -nre "$reFull" | sort -V -k 1,1 | tail -n1
}
getEntry() {
local name="$1"
for entry in $currentVersions; do
if [ "${entry%%:*}" = "$name" ]; then
echo "${entry#*:}"
return 0
fi
done
return 1
}
prefetchNew() {
local name="$1"
local version="$2"
local package="$3"
local releaseId="$4"
local url="http://www.aquamaniac.de/sites/download/download.php"
local qstring="package=$package&release=$releaseId&file=01";
nix-prefetch-url --name "$name-$version.tar.gz" "$url?$qstring"
}
processPackage() {
local name="$1"
local package="$2"
local latest="$(getLastestVersion "$package")"
local current="$(getEntry "$name")"
local currentTail="${current#*!}"
local currentVersion="${current%%!*}"
local currentSha256="${currentTail%%!*}"
local currentReleaseId="${current##*!}"
local latestVersion="${latest%%!*}"
local latestReleaseId="${latest##*!}"
if [ "$latestVersion" = "$currentVersion" -a \
"$latestReleaseId" = "$currentReleaseId" ]; then
echo " $name.version = \"$currentVersion\";"
echo " $name.sha256 = \"$currentSha256\";"
echo " $name.releaseId = \"$currentReleaseId\";"
return 0
fi
local latestSha256="$(
prefetchNew "$name" "$latestVersion" "$package" "$latestReleaseId"
)"
echo " $name.version = \"$latestVersion\";"
echo " $name.sha256 = \"$latestSha256\";"
echo " $name.releaseId = \"$latestReleaseId\";"
return 0
}
generateNewSources() {
echo "# This file is autogenerated from update.sh in the same directory."
echo "{"
for package in gwenhywfar:01 libchipcard:02 aqbanking:03; do
processPackage "${package%%:*}" "${package##*:}"
done
echo "}"
}
if newSources="$(generateNewSources)"; then
echo "$newSources" > "$basedir/sources.nix"
fi