summaryrefslogtreecommitdiff
path: root/update.sh
blob: dd57a43f30bb71db31cb6fc5f6fe6a387f43adc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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!'