avoid adequate warning
authormirabilos <tg@debian.org>
Fri, 5 Jul 2019 20:35:39 +0000 (22:35 +0200)
committermirabilos <mirabilos@evolvis.org>
Fri, 5 Jul 2019 20:35:39 +0000 (22:35 +0200)
debian/changelog
debian/musescore-common.postinst [new file with mode: 0644]
debian/musescore-common.prerm [new file with mode: 0644]

index 32d37a8..48bfb0e 100644 (file)
@@ -1,3 +1,11 @@
+musescore2 (2.3.2+dfsg3-5) wtf; urgency=low
+
+  * Create system soundfont directories in maintainer scripts,
+    so adequate does not warn and the local admin will know
+    where system-wide soundfonts are installed
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Fri, 05 Jul 2019 22:34:36 +0200
+
 musescore2 (2.3.2+dfsg3-4) wtf; urgency=low
 
   * Update UMEGAYA (DEPĀ 12) Changelog link
diff --git a/debian/musescore-common.postinst b/debian/musescore-common.postinst
new file mode 100644 (file)
index 0000000..575978f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+set -e
+
+# This maintainer script can be called the following ways:
+#
+# * new-postinst "configure" [$most_recently_configured_version]
+# The package is unpacked; all dependencies are unpacked and, when there
+# are no circular dependencies, configured.
+#
+# * old-postinst "abort-upgrade" $new_version
+# * conflictors-postinst "abort-remove" "in-favour" $package
+#      $new_version
+# * postinst "abort-remove"
+# * deconfigureds-postinst "abort-deconfigure" "in-favour"
+#      $failed_install_package $fip_version ["removing"
+#      $conflicting_package $cp_version]
+# The package is unpacked; all dependencies are at least Half-Installed,
+# previously been configured, and not removed. In some error situations,
+# dependencies may not be even fully unpacked.
+#
+# * postinst "triggered" "${triggers[*]}"
+# For trigger-only calls, i.e. if "configure" is not called.
+
+case $1 in
+configure|abort-upgrade|abort-remove|abort-deconfigure)
+       # avoid adequate warnings due to broken symlinks
+       # also points the admin to soundfont install location
+       mkdir -p \
+           /usr/share/sounds/sf2 /usr/share/sounds/sf3 /usr/share/sounds/sfz
+       ;;
+
+triggered)
+       ;;
+
+*)
+       echo >&2 "postinst called with unknown subcommand '$1'"
+       exit 1
+       ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/musescore-common.prerm b/debian/musescore-common.prerm
new file mode 100644 (file)
index 0000000..b1e50fb
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+# This maintainer script can be called the following ways:
+#
+# * prerm "remove"
+# * old-prerm "upgrade" $new_version
+# * conflictors-prerm "remove" "in-favour" $package $new_version
+# * deconfigureds-prerm "deconfigure" "in-favour"
+#      $package_being_installed $pbi_version ["removing"
+#      $conflicting_package $cp_version]
+# The package and dependencies are at least Half-Installed; dependencies
+# have previously been configured and not removed.
+#
+# * new-prerm "failed-upgrade" $old_version
+# * new-prerm "failed-upgrade" $old_version $new_version # 1.18.5, stretch
+# Called when 'old-prerm "upgrade"' fails; new package not unpacked, all
+# other constraints the same as above.
+
+case $1 in
+remove|deconfigure)
+       # remove directories if they were created in postinst
+       rmdir --ignore-fail-on-non-empty \
+           /usr/share/sounds/sf2 /usr/share/sounds/sf3 /usr/share/sounds/sfz
+       ;;
+
+upgrade|failed-upgrade)
+       ;;
+
+*)
+       echo >&2 "prerm called with unknown subcommand '$1'"
+       exit 1
+       ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0