Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > afbbe59e26ec5af653eb6852b7ebd85b > scriptlet

lam-7.1.2-14.el5.x86_64.rpm

PREUN

/bin/sh
if [ $1 -eq 0 ]; then
    mpi-selector --unregister lam-x86_64 --yes 2&>/dev/null || /bin/true
fi

POSTIN

/bin/sh
# In order to work when upgrading from older packages that used alternatives
# instead, we will need to forcably remove all the old incarnations of the
# alternatives support, and then install our mpi-selector support.

# We never used anything other than lamrun for the mpi-run link
/usr/sbin/alternatives --remove mpi-run /usr/bin/lamrun 2&>/dev/null

# but, we used lamcc, and then later lamcc-mode for mpicc....this little
# grep/awk thing catches all of them that might still be installed
/usr/sbin/alternatives --display mpicc | grep priority | grep lamcc | awk '{ system("/usr/sbin/alternatives --remove mpicc "$1) }'

# ditto for possible variants of mpilibs and mpilibs64
for i in mpilibs mpilibs64; do /usr/sbin/alternatives --display $i | grep priority | grep lam | awk '{ system("/usr/sbin/alternatives --remove '$i' "$1) }'; done

# OK, we've removed all the old alternatives configurations, now we can add
# the new mpi-selector configuration for this install.  It's safe to redo
# the add on each install/upgrade, they just reinstall in place if they
# already exist
mpi-selector --register lam-x86_64 --source-dir /usr/lib64/lam/etc --yes 2&>/dev/null || /bin/true