8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00
firebird-mirror/builds/install/arch-specific/solaris/SS/preinstall.in

44 lines
920 B
Plaintext
Raw Normal View History

#!/bin/sh
# save files which will be replaced
# don't save shell, will not be removed
FILELIST="
/etc/inet/services
/etc/profile
"
echo "saving the original modules $FILELIST ..."
if [ -f /tmp/ERROR.${PKGINST} ]
then
rm /tmp/ERROR.${PKGINST}
fi
for file in ${FILELIST};do
if [ ! -f ${PKGSAV}${file}.Z -a -f ${file} ];then
echo ${file} | tr '\040' '\012' | cpio -pvdum ${PKGSAV}
/usr/bin/compress ${PKGSAV}${file}
fi
done >/tmp/ERROR.${PKGINST} 2>&1
# check for successful saved modules
ERR=0
for file in ${FILELIST}; do
[ ! -s ${file} ] && continue
if [ ! -f ${PKGSAV}${file}.Z ]; then
if [ "$ERR" = '0' ];then
echo "\nAn error occured when saving original modules. \ntmp/ERROR.${PKGINST} contains the reported errors.\n\n"
echo "/tmp/ERROR.${PKGINST}:"
cat /tmp/ERROR.${PKGINST}
ERR=1
fi
ls -l $file ${PKGSAV}${file}.Z
fi
done
[ "$ERR" = '0' ] && rm -f /tmp/ERROR.${PKGINST}
exit 0