All pastes #163290 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-07 11:45 UTC
rendered paste body
~$ cat /var/lib/dpkg/info/g++.postinst
#! /bin/sh -e

# remove the doc dir, if it's still a directory and replace with a symlink
pkg=`basename $0 .postinst`
if [ ! -L  /usr/share/doc/$pkg ]; then
    rm -rf /usr/share/doc/$pkg
    ln -s cpp /usr/share/doc/$pkg
fi

# fix for report #138038: remove old diversions
if [ -n "`dpkg-divert --list /usr/bin/c++filt.binutils`" ]; then
    # diversion of /usr/bin/c++filt
    #   to /usr/bin/c++filt.binutils
    # /usr/bin/c++filt is from old g++
    # /usr/bin/c++filt.binutils is from current binutils
    rm -f /usr/bin/c++filt
    dpkg-divert --package g++ --rename --remove /usr/bin/c++filt \
        || true
fi
if [ -n "`dpkg-divert --list /usr/man/man1/c++filt.binutils.1.gz`" ]; then
    # diversion of /usr/man/man1/c++filt.1.gz
    #   to /usr/man/man1/c++filt.binutils.1.gz
    # /usr/man/man1/c++filt.1.gz is from old g++
    # /usr/man/man1/c++filt.binutils.1.gz does not exist any more
    # /usr/share/man/man1/c++filt.1.gz is from current binutils
    rm -f /usr/man/man1/c++filt.1.gz
    dpkg-divert --package g++ --rename --remove /usr/man/man1/c++filt.1.gz \
        || true
fi

update-alternatives \
    --install /usr/bin/c++ c++ /usr/bin/g++ 20 \
    --slave /usr/share/man/man1/c++.1.gz c++.1.gz /usr/share/man/man1/g++.1.gz



exit 0


===============
~$ cat /var/lib/dpkg/info/cpp.postinst

#! /bin/sh -e

update-alternatives --quiet --install /lib/cpp cpp /usr/bin/cpp 10


===============

~$ cat /var/lib/dpkg/info/cpp.postinst

#! /bin/sh -e

update-alternatives --quiet --install /lib/cpp cpp /usr/bin/cpp 10


stompthebozo@sarge:~$ cat /var/lib/dpkg/info/gcc.postinst
#! /bin/sh -e

# remove the doc dir, if it's still a directory and replace with a symlink
pkg=`basename $0 .postinst`
if [ ! -L  /usr/share/doc/$pkg ]; then
    rm -rf /usr/share/doc/$pkg
    ln -s cpp /usr/share/doc/$pkg
fi

update-alternatives --quiet \
    --install /usr/bin/cc cc /usr/bin/gcc 20 \
    --slave /usr/share/man/man1/cc.1.gz cc.1.gz /usr/share/man/man1/gcc.1.gz

update-alternatives --quiet \
    --install /usr/bin/c89 c89 /usr/bin/c89-gcc 20 \
    --slave /usr/share/man/man1/c89.1.gz c89.1.gz /usr/share/man/man1/c89-gcc.1.gz

update-alternatives --quiet \
    --install /usr/bin/c99 c99 /usr/bin/c99-gcc 20 \
    --slave /usr/share/man/man1/c99.1.gz c99.1.gz /usr/share/man/man1/c99-gcc.1.gz

# remove f77 alternative left over from an old egcs version ...
if [ -h /etc/alternatives/f77 -a ! -e /etc/alternatives/f77 ]; then
    rm -f /etc/alternatives/f77
fi



exit 0

///////////////// END //////////////////////