summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xupdate.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/update.sh b/update.sh
index 7a693aa..f0b3264 100755
--- a/update.sh
+++ b/update.sh
@@ -1,3 +1,25 @@
#!/bin/bash
+set -e
+pkg="$1"
+version="$2"
+
+cd /usr/src/ports/*/${pkg}
+oldVer=$(
+ sed -n '
+ s/^version=//
+ T
+ p
+ ' Pkgfile
+)
+sed -i '
+ /^version=/ s/=.*$/='"${version}"'/
+' Pkgfile
+sudo -u pkgmk fakeroot pkgmk -if -im -is -d
+pkgmk -uf
+pkgmk -um
+pkgmk -us -sk /etc/ports/deepthought.sec
+git commit . -m "${pkg}: ${oldver} -> ${version}"
+
+echo 'Erfolg!'