i586-support.sh 1.06 KB
Newer Older
1 2 3 4
#!/bin/sh

[ "$1" != "--run" ] && echo "Add 32 bit support on 64 bit system" && exit

5 6
. $(dirname $0)/common.sh

7 8 9 10 11 12 13 14 15 16
[ "$(epm print info -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1


vendor="$(epm print info -s)"
case "$vendor" in
    "alt")
        if epm --quiet repo list | grep -q "x86_64-i586 classic" ; then
            #[ -n "$verbose" ] && info "This system is ready to install 32bit packages"
            exit 0
        else
17
            epm repo add "$(epm --quiet repo list | grep "x86_64 classic" | sed -e 's|x86_64|x86_64-i586|')"
18 19
            epm update
        fi
20
        exit
21
        ;;
22 23 24 25
esac

pkgtype="$(epm print info -p)"
case "$pkgtype" in
26 27 28 29 30 31 32 33 34 35 36 37 38 39
    "deb")
        if a= dpkg --print-foreign-architectures | grep -q "i386" ; then
            #[ -n "$verbose" ] && info "This system is ready to install 32bit packages"
            exit 0
        else
            a= dpkg --add-architecture i386
            epm update
        fi
        ;;
    *)
        info "Unsupported $(epm print info -e) system. Just skipping the operation."
        exit
        ;;
esac