summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin2015-06-03 10:21:35 +0200
committerFlorian Bruhin2015-06-03 10:21:35 +0200
commit69f1f55fa54d0669d54e08631544d6134351fd86 (patch)
tree2c8c4f47ff94df956866f37b8ff6c18a364be0af
parentca4df8bd5543539320461cfcdbf6eff59963f335 (diff)
downloadaur-69f1f55fa54d0669d54e08631544d6134351fd86.tar.gz
agendav: Use pre_upgrade to save configs.
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD5
-rw-r--r--agendav.install26
3 files changed, 16 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e3ba88d0dbd..1d2ce4a07d7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -10,9 +10,6 @@ pkgbase = agendav
backup = etc/webapps/agendav/config.php
backup = etc/webapps/agendav/caldav.php
backup = etc/webapps/agendav/database.php
- backup = usr/share/webapps/agendav/web/config/config.php
- backup = usr/share/webapps/agendav/web/config/caldav.php
- backup = usr/share/webapps/agendav/web/config/database.php
source = agendav-1.2.6.2.tar.gz::https://github.com/adobo/agendav/archive/1.2.6.2.tar.gz
source = nginx.example.conf
source = apache.example.conf
diff --git a/PKGBUILD b/PKGBUILD
index 926573ae8c5..4dcbe1cf36f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,10 +15,7 @@ depends=('php')
# those file up every time...
backup=("etc/webapps/agendav/config.php"
"etc/webapps/agendav/caldav.php"
- "etc/webapps/agendav/database.php"
- "usr/share/webapps/agendav/web/config/config.php"
- "usr/share/webapps/agendav/web/config/caldav.php"
- "usr/share/webapps/agendav/web/config/database.php")
+ "etc/webapps/agendav/database.php")
source=($pkgname-$pkgver.tar.gz::https://github.com/adobo/${pkgname}/archive/${pkgver}.tar.gz
nginx.example.conf
apache.example.conf)
diff --git a/agendav.install b/agendav.install
index a06e289f26c..051af4e228c 100644
--- a/agendav.install
+++ b/agendav.install
@@ -2,15 +2,19 @@ post_install() {
echo "Check http://wiki.archlinux.org/index.php/AgenDAV for details."
}
-post_upgrade() {
- echo "Since pkgrel -3, the incorrect symlinking of config files in this "
- echo "package has been fixed. This however means pacman will install "
- echo "the correct files as /etc/webapps/agendav/*.php.pacnew and leave a "
- echo "broken symlink as *.php. This means AgenDAV will report no config "
- echo "has been found."
- echo
- echo "Your existing config files should have been backed up in "
- echo "/usr/share/webapps/agendav/config/web/*.php.pacbak. This means you "
- echo "can probably fix things up by running this now:"
- echo "FIXME"
+pre_upgrade() {
+ ## Fix mess caused by the old package which had the symlinks the wrong way
+ ## around, so the user's config doesn't get lost...
+ for f in config.php caldav.php database.php; do
+ if [[ -h "/etc/webapps/agendav/$f" ]]; then
+ echo
+ echo "==> Fixing broken $f symlink from old package..."
+ # remove symlink first
+ echo "rm /etc/webapps/agendav/$f"
+ rm "/etc/webapps/agendav/$f"
+ # now move the real file (with the user's config) to /etc
+ echo "mv /usr/share/webapps/agendav/web/config/$f /etc/webapps/agendav"
+ mv "/usr/share/webapps/agendav/web/config/$f" /etc/webapps/agendav
+ fi
+ done
}