Use tmpfiles more, check jackett user home dir at every upgrade, suggest fix.

This commit is contained in:
Donald Webster 2018-03-18 12:45:34 -07:00
parent 04d08a5a16
commit baed11391f
5 changed files with 12 additions and 17 deletions

View file

@ -15,7 +15,7 @@ pkgbase = jackett
sha256sums = fa9882b6d2d415185dbfa2768e09db27f26264983de3b46948ef40b6466f7fad
sha256sums = 75837fe04f5afd30cdbdd3349bb27b43994dc672202f886382903f7fbc92dc89
sha256sums = d005fcd009ec5404e1ec88246c31e664167f5551d6cabc35f68eb41750bfe590
sha256sums = 289b7ea9394fe7d97a2fb8fdc1e67168ab7858ed2aa8fa881038eb70666ddec3
sha256sums = 79ec8a9a072c3ca69556102edc50ad97fc65565d18b19ff054993a176e8e3898
pkgname = jackett

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
*.xz
*.gz
*.log
/src/
/pkg/

View file

@ -15,7 +15,7 @@ source=("Jackett.Binaries.Mono-${pkgver}.tar.gz::https://github.com/Jackett/Jack
sha256sums=('fa9882b6d2d415185dbfa2768e09db27f26264983de3b46948ef40b6466f7fad'
'75837fe04f5afd30cdbdd3349bb27b43994dc672202f886382903f7fbc92dc89'
'd005fcd009ec5404e1ec88246c31e664167f5551d6cabc35f68eb41750bfe590'
'289b7ea9394fe7d97a2fb8fdc1e67168ab7858ed2aa8fa881038eb70666ddec3')
'79ec8a9a072c3ca69556102edc50ad97fc65565d18b19ff054993a176e8e3898')
package() {
cd "$srcdir"

View file

@ -1,12 +1,7 @@
post_install() {
chown -R jackett: /usr/lib/jackett
}
post_upgrade() {
# At version 0.8.749-2 we moved configs to /var/lib/jackett, so
# migrate old config directory.
if [[ $(vercmp "0.8.749-2" "$2") -eq 1 ]]; then
# Check for existing old config directory and non-existance of new config file.
if [[ -d /usr/share/Jackett/.config/Jackett && ! -f /var/lib/jackett/ServerConfig.json ]]; then
cp -a /usr/share/Jackett/.config/Jackett/* /var/lib/jackett/
@ -17,18 +12,15 @@ post_upgrade() {
cp -a /usr/share/Jackett/.config/.mono /var/lib/jackett/
fi
# Stop jackett so user's home directory can be changed.
systemctl stop jackett
if [[ "$( getent passwd jackett | cut -d: -f6 )" != "/var/lib/jackett" ]]; then
usermod -d /var/lib/jackett jackett
fi
echo "Configs copied from /usr/share/Jackett/.config/Jackett -> /var/lib/jackett/."
echo "After confirming, rm -rf /opt/Jackett /usr/share/Jackett."
echo
echo "To modify jackett user's home directory, the jackett service was stopped."
echo "Start it again by running: sudo systemctl start jackett"
fi
post_install "$1"
if [[ "$( getent passwd jackett | cut -d: -f6 )" != "/var/lib/jackett" ]]; then
usermod -d /var/lib/jackett jackett
if [[ $? -ne 0 ]]; then
echo "Could not change jackett users home directory."
echo "Run: sudo systemctl stop jackett ; sudo usermod -d /var/lib/jackett jackett ; sudo systemctl start jackett"
fi
fi
}

View file

@ -1 +1,3 @@
d /var/lib/jackett 0755 jackett jackett
Z /var/lib/jackett - jackett jackett
Z /usr/lib/jackett - jackett jackett