File: ia32-libs.postrm

package info (click to toggle)
ia32-libs 1.4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 210,392 kB
  • ctags: 7
  • sloc: sh: 168; makefile: 123
file content (31 lines) | stat: -rw-r--r-- 641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -e

if [ $(lsb_release -i -s) = "Debian" ]; then
    ROOT=/emul/ia32-linux
    SUFFIX=
else
    ROOT=
    SUFFIX=32
fi

removeline () {
    if grep -q "^/$1$" "$2"; then
		grep -v "^$1$" "$2" > "$2".ia32-libs-tmp
		chmod 0644 "$2".ia32-libs-tmp
		mv /etc/"$2".ia32-libs-tmp "$2"
    fi
}

if [ "$1" = "remove" ]; then
    removeline ${ROOT}/lib${SUFFIX} /etc/ld.so.conf
    removeline ${ROOT}/usr/lib${SUFFIX} /etc/ld.so.conf
    removeline ${ROOT}/usr/X11R6/lib${SUFFIX} /etc/ld.so.conf

    ldconfig

    dpkg-divert --divert /usr/bin/ldd.ia32-libs --quiet --rename --package ia32-libs --remove /usr/bin/ldd
fi

#DEBHELPER#