hstr
hstr copied to clipboard
Automatically update sha256sums
Hello Martin Dvorak,
here is an idea for an enhancement. If you download hstr directly from github and try to build it you get a validation error:
==> Validating source files with sha256sums... hstr-1.27.tar.gz ... FAILED ==> ERROR: One or more files did not pass the validity check!
Although editing PKGBUILD is not a big deal it does not work for everyone. So it would be nice to have the the sha256sums=(xxx)
in PKGBUILD automatically updated after every commit.
Thanks for your work.
@smartshogu Thank you! I was not aware of that.
Hints:
-
stuck on inability to install Pacman's
makepkg
on Ubuntu - https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
mg() {
if [ ! -f ./PKGBUILD ]; then
echo "No PKGBUILD in `pwd`"
return 1
fi
local sums
# calculate new md5sums
sums=$(makepkg -g)
# replace them in-place
sed -i "s/^md5sums=.*/%NEWSUMS%/;/'[a-z0-9]\{32\}'/d;s/%NEWSUMS%/$sums/" PKGBUILD
echo "PKGBUILD updated"
}