summarylogtreecommitdiffstats
path: root/pkgsum.sh
blob: 6a1258f57f9d40652b0583988ff95f6d56bc6446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

#taken from https://bbs.archlinux.org/viewtopic.php?id=131666 by falconindy
awk -v newsums="$(makepkg -g)" '
BEGIN {
  if (!newsums) exit 1
}

/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*$/ {
  if (!i) print newsums; i++
  next
}

1
' PKGBUILD > PKGBUILD.new && mv PKGBUILD{.new,}
if which makepkg &> /dev/null; then
  makepkg --printsrcinfo > .SRCINFO
else
  mksrcinfo
fi