Files
mingw-sword-build/update.nix
T
Greg Hellings e63569a1ac
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Update to latest build
2026-01-31 11:40:46 -06:00

40 lines
852 B
Nix

{
writeShellApplication,
gnugrep,
gnused,
nix-prefetch,
subversion,
}:
writeShellApplication {
name = "sword-updater";
runtimeInputs = [
gnugrep
gnused
nix-prefetch
subversion
];
text = ''
url="https://www.crosswire.org/svn/sword/trunk"
old_rev="$(grep "${./flake.nix}" -e "rev = " | sed -E -e 's/.*"(.*)".*/\1/')"
echo "OLD_REV=$old_rev"
new_rev="$(svn info "$url" --show-item revision)"
echo "NEW_REV=$new_rev"
if [ "$new_rev" == "$old_rev" ]; then
exit 0
else
echo "DO_UPDATE=1"
fi
hash="$(nix-prefetch \
--check-store \
--option extra-experimental-features flakes \
fetchsvn \
--url "$url" \
--rev "$new_rev" \
)"
echo "HASH=$hash"
sed -i flake.nix \
-e "s/rev = \"$old_rev\"/rev = \"$new_rev\"/"
'';
}