From 2eeddc97869575c3f88221d2d2efc161a2f3a5fc Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 1 Oct 2018 23:11:14 +0200 Subject: [PATCH] Fix: renaming of /var/lib/mympd/smartpls/*.dist files --- contrib/archlinux.install | 13 ++++++++----- contrib/myMPD.spec | 13 ++++++++----- debian/postinst | 14 +++++++++----- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/contrib/archlinux.install b/contrib/archlinux.install index deaea09..23d360b 100644 --- a/contrib/archlinux.install +++ b/contrib/archlinux.install @@ -52,12 +52,15 @@ post_upgrade() { # move smartpls into place unless already existing for PLDIST in /var/lib/mympd/smartpls/*.dist do - PLS=$(basename $PLDIST .dist) - if [ -f /var/lib/mympd/smartpls/$PLS ] + if [ -f "$PLDIST" ] then - rm $PLDIST - else - mv $PLDIST /var/lib/mympd/smartpls/$PLS + PLS=$(basename $PLDIST .dist) + if [ -f /var/lib/mympd/smartpls/$PLS ] + then + rm $PLDIST + else + mv -v $PLDIST /var/lib/mympd/smartpls/$PLS + fi fi done diff --git a/contrib/myMPD.spec b/contrib/myMPD.spec index fba2b80..c584db3 100644 --- a/contrib/myMPD.spec +++ b/contrib/myMPD.spec @@ -66,12 +66,15 @@ fi # move smartpls into place unless already existing for PLDIST in /var/lib/mympd/smartpls/*.dist do - PLS=$(basename $PLDIST .dist) - if [ -f /var/lib/mympd/smartpls/$PLS ] + if [ -f "$PLDIST" ] then - rm $PLDIST - else - mv $PLDIST /var/lib/mympd/smartpls/$PLS + PLS=$(basename $PLDIST .dist) + if [ -f /var/lib/mympd/smartpls/$PLS ] + then + rm $PLDIST + else + mv -v $PLDIST /var/lib/mympd/smartpls/$PLS + fi fi done diff --git a/debian/postinst b/debian/postinst index 3103f1a..ecff3a1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -36,15 +36,19 @@ fi # move smartpls into place unless already existing for PLDIST in /var/lib/mympd/smartpls/*.dist do - PLS=$(basename $PLDIST .dist) - if [ -f /var/lib/mympd/smartpls/$PLS ] + if [ -f "$PLDIST" ] then - rm $PLDIST - else - mv $PLDIST /var/lib/mympd/smartpls/$PLS + PLS=$(basename $PLDIST .dist) + if [ -f /var/lib/mympd/smartpls/$PLS ] + then + rm $PLDIST + else + mv -v $PLDIST /var/lib/mympd/smartpls/$PLS + fi fi done + # move config into place unless already existing if [ ! -f /etc/mympd/mympd.conf ] then