summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdvinas Valatka2017-02-19 02:11:27 +0200
committerEdvinas Valatka2017-02-19 02:11:27 +0200
commit1d87d3bec12a415ffbe3991337d6f6673998e622 (patch)
tree5be5d0a9f82584b2d8c30882b9c83067ac8749e1
parent41045a00000b50e9704125f00abf737af069e5e1 (diff)
downloadaur-1d87d3bec12a415ffbe3991337d6f6673998e622.tar.gz
Migrate configuration file
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD4
-rw-r--r--gogs.install29
3 files changed, 23 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index edc45538e3dc..413bd4845fa7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Fri Feb 17 22:20:37 UTC 2017
+# Sun Feb 19 00:09:42 UTC 2017
pkgbase = gogs-dev-git
pkgdesc = Self Hosted Git Service in the Go Programming Language. This is the current git version from branch develop.
- pkgver = 0.9.154.0217+3+81e74858
+ pkgver = 0.9.158.0218+5+c6990032
pkgrel = 1
url = http://gogs.io/
install = gogs.install
@@ -27,7 +27,6 @@ pkgbase = gogs-dev-git
replaces = gogs-git-dev
options = !buildflags
options = !strip
- backup = etc/gogs/app.ini
source = git+https://github.com/gogits/gogs.git#branch=develop
source = git+https://github.com/jteeuwen/go-bindata.git
source = gogs.service
diff --git a/PKGBUILD b/PKGBUILD
index d1aeae0625a7..e840681ed89e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ _pkgname=gogs
_team=github.com/gogits
_gogsdir="src/${_team}/${_pkgname}"
pkgname=${_pkgname}-dev-git
-pkgver=0.9.154.0217+3+81e74858
+pkgver=0.9.158.0218+5+c6990032
pkgrel=1
pkgdesc="Self Hosted Git Service in the Go Programming Language. This is the current git version from branch ${_branch}."
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
@@ -27,7 +27,6 @@ optdepends=(
"openssh: GIT over SSH support"
)
makedepends=('go' 'git' 'nodejs-less')
-backup=("etc/${_pkgname}/app.ini")
install=${_pkgname}.install
source=(
@@ -94,7 +93,6 @@ package() {
install -Dm0644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/${_pkgname}.service"
install -Dm0644 "$srcdir/${_pkgname}.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/${_pkgname}.conf"
- install -Dm064 -t "$pkgdir/etc/${_pkgname}" ./conf/app.ini
}
diff --git a/gogs.install b/gogs.install
index c7819d81c41d..87993db60236 100644
--- a/gogs.install
+++ b/gogs.install
@@ -31,12 +31,13 @@ pre_install() {
if [ ${_OldHome} != "/srv/gogs" ]; then
echo
echo "Setting gogs home directory to /srv/gogs"
- _disable_if_enabled
+ usermod -c 'Gogs service user' -g gogs -d /srv/gogs -L -s /bin/bash gogs
+ echo
echo "You must migrate from ${_OldHome}"
echo "before starting or re-enabling service"
echo
+ _disable_if_enabled
fi
- usermod -c 'Gogs service user' -g gogs -d /srv/gogs -L -s /bin/bash gogs
fi
}
@@ -52,15 +53,23 @@ pre_upgrade() {
post_upgrade() {
post_install
- if ! [[ -f /etc/gogs/app.ini.pacnew ]] ; then
- _start_if_enabled
- else
+
+ local _CustConf=/srv/gogs/custom/conf/app.ini
+ local _OldConf=/etc/gogs/app.ini
+
+ if [[ -f ${_OldConf}.pacsave ]] && [[ ! -f ${_CustConf} ]] ; then
+ install -Dm0750 -d -o gogs -g gogs /srv/gogs
+ install -Dm0750 -d -o gogs -g gogs /srv/gogs/custom
+ install -Dm0750 -d -o gogs -g gogs /srv/gogs/custom/conf
+ install -Dm0640 -T -o gogs -g gogs ${_OldConf}.pacsave ${_CustConf}
echo
- _disable_if_enabled
- echo "/etc/gogs/app.ini{,.pacnew} needs merge"
- echo "before starting or re-enabling service"
+ echo "${_OldConf} moved to"
+ echo "${_CustConf}."
+ echo "You may need to manually delete"
+ echo "an old config dir /etc/gogs"
echo
fi
+ _start_if_enabled
}
pre_remove() {
@@ -76,5 +85,7 @@ post_remove() {
groupdel gogs
fi
systemctl daemon-reload
- echo "You will need to delete the directory /srv/gogs manually"
+ echo
+ echo "You may need to manually delete an old workdir /srv/gogs"
+ echo
}