summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD2
-rw-r--r--asd.install65
3 files changed, 22 insertions, 49 deletions
diff --git a/.SRCINFO b/.SRCINFO
index aaaf85af663..181507d36b0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = anything-sync-daemon
pkgdesc = Offload anything to RAM (tmpfs) for speed and wear reduction.
- pkgver = 5.75
+ pkgver = 5.76
pkgrel = 1
url = https://github.com/graysky2/anything-sync-daemon
install = asd.install
@@ -16,7 +16,7 @@ pkgbase = anything-sync-daemon
conflicts = tmpfs-store
conflicts = tmpfs-sync
backup = etc/asd.conf
- source = http://repo-ck.com/source/anything-sync-daemon/anything-sync-daemon-5.75.tar.xz
+ source = http://repo-ck.com/source/anything-sync-daemon/anything-sync-daemon-5.76.tar.xz
sha256sums = 02e69263138db2e377e6e1950ff5cfdc4b7a2441e438df048b6f9de4479ba805
pkgname = anything-sync-daemon
diff --git a/PKGBUILD b/PKGBUILD
index f878c970fcd..09f6ff44f93 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: graysky <graysky AT archlinux DOT us>
pkgname='anything-sync-daemon'
-pkgver=5.75
+pkgver=5.76
pkgrel=1
pkgdesc='Offload anything to RAM (tmpfs) for speed and wear reduction.'
arch=('any')
diff --git a/asd.install b/asd.install
index 71cb86943d7..ade2c84eb7f 100644
--- a/asd.install
+++ b/asd.install
@@ -1,23 +1,21 @@
-DAEMON_FILE="/run/asd"
+## arg 1: the new package version
+## arg 2: the old package version
-pre_upgrade() {
- ## arg 1: the new package version
- ## arg 2: the old package version
- oldpkgver=${2%-*}
+_stopit() {
+ systemctl is-active asd.service &>/dev/null
+ if [ $? -eq 0 ]; then
+ echo '--> Pacman must stop asd before it can upgrade.'
+ echo '--> Please start it manually once the upgrade is complete.'
+ systemctl stop asd.service &>/dev/null
+ fi
+}
- if [[ $oldpkgver < 5.69 ]]; then
- if [ -e $DAEMON_FILE ]; then
- if ! systemd-notify --booted; then # not using systemd
- echo '--> Pacman must stop asd before it can upgrade.'
- echo '--> Please start it manually once the upgrade is complete.'
- /etc/rc.d/asd stop
- else
- echo '--> Pacman must stop asd before it can upgrade.'
- echo '--> Please start it manually once the upgrade is complete.'
- /usr/bin/systemctl stop asd
- fi
+pre_upgrade() {
+ for version in 5.69 5.76; do
+ if [ $(vercmp $2 $version) -lt 0 ]; then
+ _stopit
fi
- fi
+ done
}
post_install() {
@@ -30,35 +28,10 @@ post_install() {
echo '--------------------------------------------------------------------------'
}
-post_upgrade() {
- ## arg 1: the new package version
- ## arg 2: the old package version
- oldpkgver=${2%-*}
- #newpkgver=${1%-*}
-
- if [[ $oldpkgver < 3.13 ]]; then
- echo '-------------------------------------------------------------------'
- echo ' Support for cron has been deprecated in favor of a systemd timer.'
- echo ' This package now provides both asd.service and asd-resync.service'
- echo
- echo ' systemctl enable asd asd-resync'
- echo ' systemctl start asd asd-resync'
- echo
- echo ' See the wiki or man page for more info.'
- echo '-------------------------------------------------------------------'
- else
- /bin/true
- fi
-}
-
pre_remove() {
- if [ -e $DAEMON_FILE ]; then
- if ! systemd-notify --booted; then # not using systemd
- echo '--> Automatically stopping asd to rotate data back out of tmpfs.'
- /etc/rc.d/asd stop
- else
- echo '--> Automatically stopping asd to rotate data back out of tmpfs.'
- /usr/bin/systemctl stop asd
- fi
+ systemctl is-active asd.service &>/dev/null
+ if [ $? -eq 0 ]; then
+ echo '--> In order to preserve your data, pacman will now stop asd.'
+ systemctl stop asd.service &>/dev/null
fi
}