Created
May 14, 2016 21:53
-
-
Save rshipp/b6996076c0fa3ae0e7e71eee7f0e0c48 to your computer and use it in GitHub Desktop.
Haskell helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
name=$1 | |
version=$(wget http://hackage.haskell.org/package/$name -qO- | grep Change\ log | sed 's,^.*<strong>\([0-9\.]*\)</strong></td></tr><tr><th>Change.*$,\1,') | |
echo Building $name-$version | |
cp -R haskell-conduit haskell-$name | |
cd haskell-$name | |
sed -i s/conduit/$name/g PKGBUILD | |
sed -i s/1.2.6.6/$version/g PKGBUILD | |
sed -i s/conduit/$name/g *.install | |
mv haskell-{conduit,$name}.install | |
../update_sums.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldsums=$(sed -n '/^.*sums=(.*/,/.*)/p' PKGBUILD) | |
newsums=$(makepkg -g) | |
sed -i "/^.*sums=(.*/,/.*)$/y/${oldsums//$'\n'/\\n}/${newsums//$'\n'/\\n}/" PKGBUILD 2>/dev/null || | |
sed -i "s/^.*sums=(.*).*$/${newsums/$'\n'/}/" PKGBUILD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment