Feat: install don't override existing smart playlists

This commit is contained in:
jcorporation 2018-10-01 20:12:59 +01:00
parent bf188ebdc2
commit f9dc014adc
7 changed files with 38 additions and 0 deletions

View File

@ -56,4 +56,5 @@ install(FILES dist/htdocs/css/mympd.min.css DESTINATION share/${PROJECT_NAME}/ht
install(DIRECTORY htdocs/assets DESTINATION share/${PROJECT_NAME}/htdocs)
install(DIRECTORY DESTINATION ../var/lib/${PROJECT_NAME}/pics)
install(DIRECTORY DESTINATION ../var/lib/${PROJECT_NAME}/tmp)
install(DIRECTORY DESTINATION ../var/lib/${PROJECT_NAME}/state)
install(DIRECTORY dist/smartpls DESTINATION ../var/lib/${PROJECT_NAME})

View File

@ -49,6 +49,18 @@ post_upgrade() {
/usr/share/mympd/crcert.sh
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 ]
then
rm $PLDIST
else
mv $PLDIST /var/lib/mympd/smartpls/$PLS
fi
done
# move config into place unless already existing
if [ ! -f /etc/mympd/mympd.conf ]
then

View File

@ -63,6 +63,19 @@ fi
[ -e /usr/share/mympd/htdocs/pics ] || ln -s /var/lib/mympd/pics /usr/share/mympd/htdocs/
# 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 ]
then
rm $PLDIST
else
mv $PLDIST /var/lib/mympd/smartpls/$PLS
fi
done
# move config into place unless already existing
if [ ! -f /etc/mympd/mympd.conf ]
then
mv /etc/mympd/mympd.conf.dist /etc/mympd/mympd.conf

12
debian/postinst vendored
View File

@ -33,6 +33,18 @@ then
systemctl enable mympd
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 ]
then
rm $PLDIST
else
mv $PLDIST /var/lib/mympd/smartpls/$PLS
fi
done
# move config into place unless already existing
if [ ! -f /etc/mympd/mympd.conf ]
then