Debian Codegraph @

debian/mono-runtime.postinst

raw
1 #!/bin/sh
2 set -e
3
4 if [ "$1" = configure ]; then
5 if [ -d /usr/share/dotnet/mono/ ] && [ -L /usr/share/dotnet/mono ]; then
6 # it's a symlink
7 rm /usr/share/dotnet/mono
8 fi
9 MONOARCH=$(mono --version | grep Architecture | sed 's/.*: //' | sed 's/el,.*//')
10 mkdir -p /usr/lib/mono/aot-cache/${MONOARCH}/
11 mono \
12 --aot=outfile=/usr/lib/mono/aot-cache/${MONOARCH}/mscorlib.dll.so \
13 -O=all /usr/lib/mono/4.5/mscorlib.dll > /dev/null 2>&1 || true
14 fi
15
16 # Update the alternatives
17 update-alternatives \
18 --install /usr/bin/cli cli /usr/bin/mono 10 \
19 --slave /usr/share/man/man1/cli.1.gz cli.1.gz /usr/share/man/man1/mono.1.gz
20 update-alternatives \
21 --install /usr/bin/cli-gacutil global-assembly-cache-tool /usr/bin/gacutil 10 \
22 --slave /usr/share/man/man1/cli-gacutil.1.gz cli-gacutil.1.gz /usr/share/man/man1/gacutil.1.gz
23
24 # Drop binfmt integration, if it has been enabled by a prior version of Mono.
25 # This command does not fail if integration was not already setup.
26 if command -v update-binfmts >/dev/null; then
27 update-binfmts --package mono-runtime --remove cli /usr/bin/cli 2>/dev/null
28 fi
29
30 #DEBHELPER#