]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
alsa: Don't fail on upgrading the package
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 14:22:52 +0000 (15:22 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 14:22:52 +0000 (15:22 +0100)
If alsa has not been started on a system the upgrade script fails with
exit code 1 and prevents Pakfire from completing the update.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/paks/alsa/update.sh

index 14cf836b2d64c4d03eee016767963d6d03bccf40..6ea2cdbb2586b97f13235f0614aa15245114f3da 100644 (file)
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
-mv /etc/asound.state /tmp
+
+# Backup /etc/asound.state
+if [ -e "/etc/asound.state" ]; then
+       mv /etc/asound.state /tmp/asound.state
+fi
+
 extract_backup_includes
 ./uninstall.sh
 ./install.sh
-mv /tmp/asound.state /etc
+
+# Restore asound.state
+if [ -e "/tmp/asound.state" ]; then
+       mv /tmp/asound.state /etc/asound.state
+fi
+
+exit 0