summaryrefslogtreecommitdiff
path: root/update.sh
blob: 31ca1195e14f83e797dd730ab23ec193ae1bc271 (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!'