summaryrefslogtreecommitdiffstats
path: root/debian/@LCNAME@-support.preinst.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:36:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:36:24 +0000
commit6c1c3157a2298129cfc0573a00c551b82c0250d8 (patch)
tree6f3b4b0a342b940c074d73e39ed671fd8e3001db /debian/@LCNAME@-support.preinst.in
parentAdding upstream version 15.1. (diff)
downloadisa-support-6c1c3157a2298129cfc0573a00c551b82c0250d8.tar.xz
isa-support-6c1c3157a2298129cfc0573a00c551b82c0250d8.zip
Adding debian version 15.1.debian/15.1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/@LCNAME@-support.preinst.in')
-rw-r--r--debian/@LCNAME@-support.preinst.in50
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/@LCNAME@-support.preinst.in b/debian/@LCNAME@-support.preinst.in
new file mode 100644
index 0000000..ed1242c
--- /dev/null
+++ b/debian/@LCNAME@-support.preinst.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = install ] || [ "$1" = upgrade ]; then
+ FILE="/usr/libexec/@DEB_HOST_MULTIARCH@/isa-support/test-@NAME@"
+ # "exec >;command" instead of "command >" looks strange but regular
+ # redirections don't fully work within qemu-user.
+ ret=0;(exec >/dev/null 2>&1; "$FILE") || ret=$?
+ if [ $ret -ne 0 ] && [ -n "$IGNORE_ISA" ]; then
+ cat >&2 <<END
+This machine doesn't support @NAME@, but override (IGNORE_ISA) is enabled.
+Continuing...
+END
+ ret=0
+ fi
+
+ if [ $ret -eq 126 ]; then
+ cat >&2 <<END
+Couldn't execute test binary for @NAME@, you either do foreign multi-arch
+without qemu or do something strange. Assuming you know what you're doing.
+Continuing...
+END
+ ret=0
+ fi
+
+ if [ $ret -ne 0 ]; then
+ # Fail noisily, first via debconf (if installed).
+ if [ -e /usr/share/debconf/confmodule ]; then
+
+ . /usr/share/debconf/confmodule
+ db_version 2.0
+
+ db_fset @NAME@-support/fail seen false ||:
+ db_reset @NAME@-support/fail ||:
+ db_input critical @NAME@-support/fail ||:
+ db_go ||:
+ db_stop ||:
+ fi
+
+ cat >&2 <<END
+This machine doesn't support @NAME@, sorry.
+Aborting.
+END
+ exit 2
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0