INTEGRATION: CWS sdkinstaller (1.14.8); FILE MERGED

2005/10/31 12:19:01 obr 1.14.8.1: made user install scripts work with SDK and URE packages as well
This commit is contained in:
Rüdiger Timm
2005-11-09 08:26:42 +00:00
parent ec72788582
commit c9c1ee56a3
2 changed files with 65 additions and 21 deletions

View File

@@ -86,7 +86,13 @@ fi
#
INSTALLDIR=$2
RPM_DB_PATH=${INSTALLDIR}/.RPM_OFFICEDATABASE
# Check for old style .RPM_OFFICEDATABASE first
if [ -d ${INSTALLDIR}/.RPM_OFFICEDATABASE ]; then
RPM_DB_PATH=${INSTALLDIR}/.RPM_OFFICEDATABASE
else
RPM_DB_PATH=${INSTALLDIR}/.RPM_DATABASE
fi
# Check for versionrc
if [ -f ${INSTALLDIR}/program/versionrc ]; then VERSIONRC=versionrc; fi
@@ -117,6 +123,21 @@ p
exit 2
fi
done
elif [ -d $RPM_DB_PATH ]
then
echo
echo "The following packages are already installed in $INSTALLDIR"
echo
rpm --dbpath `cd $RPM_DB_PATH; pwd` --query --all
echo
while [ "$UPDATE" != "yes" ]
do
read -a UPDATE -p "Do you want to continue with this installation (yes/no)? "
if [ "$UPDATE" = "no" ]
then
exit 2
fi
done
else
UPDATE="no"
fi
@@ -129,7 +150,7 @@ fi
if [ "$UPDATE" = "yes" ]
then
# restore original bootstraprc
mv -f ${INSTALLDIR}/program/bootstraprc.orig ${INSTALLDIR}/program/bootstraprc
mv -f ${INSTALLDIR}/program/bootstraprc.orig ${INSTALLDIR}/program/bootstraprc 2>/dev/null
# the RPM_DB_PATH must be absolute
if [ ! "${RPM_DB_PATH:0:1}" = "/" ]; then
@@ -193,9 +214,23 @@ then
ln -sf $INSTALLDIR/program/soffice $HOME/soffice
fi
if [ "$UPDATE" = "yes" -a ! -f $INSTALLDIR/program/bootstraprc ]
then
echo
echo "Update failed due to a bug in RPM, uninstalling .."
rpm --erase -v --nodeps --dbpath $RPM_DB_PATH `rpm --query --queryformat "%{NAME} " --package $RPMLIST $GNOMERPM --dbpath $RPM_DB_PATH`
echo
echo "Now re-installing new packages .."
echo
rpm --upgrade --nodeps --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST $GNOMERPM
echo
fi
# patch the "bootstraprc" to create a self-containing installation
mv $INSTALLDIR/program/bootstraprc $INSTALLDIR/program/bootstraprc.orig
sed 's/UserInstallation=$SYSUSERCONFIG.*/UserInstallation=$ORIGIN\/..\/UserInstallation/g' $INSTALLDIR/program/bootstraprc.orig > $INSTALLDIR/program/bootstraprc
if [ -f $INSTALLDIR/program/bootstraprc ]; then
mv $INSTALLDIR/program/bootstraprc $INSTALLDIR/program/bootstraprc.orig
sed 's/UserInstallation=$SYSUSERCONFIG.*/UserInstallation=$ORIGIN\/..\/UserInstallation/g' $INSTALLDIR/program/bootstraprc.orig > $INSTALLDIR/program/bootstraprc
fi
echo
echo "Installation done ..."

View File

@@ -153,11 +153,14 @@ then
INSTALL_ROOT=`cd ${INSTALL_ROOT}; pwd`
fi
INSTALL_DIR=${INSTALL_ROOT}`pkgparam -f ${INSTALL_ROOT}/var/sadm/pkg/*core01/pkginfo BASEDIR`
OFFICE_DIR=${INSTALL_ROOT}`pkgparam -f ${INSTALL_ROOT}/var/sadm/pkg/*core01/pkginfo BASEDIR 2>/dev/null`
# restore original "bootstraprc" and "soffice" prior to patching
mv -f ${INSTALL_DIR}/program/bootstraprc.orig ${INSTALL_DIR}/program/bootstraprc
mv -f ${INSTALL_DIR}/program/soffice.orig ${INSTALL_DIR}/program/soffice
if [ "${OFFICE_DIR}" != "" ]
then
mv -f ${OFFICE_DIR}/program/bootstraprc.orig ${OFFICE_DIR}/program/bootstraprc
mv -f ${OFFICE_DIR}/program/soffice.orig ${OFFICE_DIR}/program/soffice
fi
# copy INST_RELEASE file
if [ ! -f ${INSTALL_ROOT}/var/sadm/system/admin/INST_RELEASE ]
@@ -167,20 +170,22 @@ then
fi
LD_PRELOAD_32=$GETUID_SO /usr/sbin/patchadd -R ${INSTALL_ROOT} -M ${PATCH_PATH} ${PATCH_LIST} 2>&1 | grep -v '/var/sadm/patch'
else
# Create /usr directory required by co-packages like SUNWfreetype2
mkdir -m 0755 -p ${INSTALL_ROOT}/usr
# Create BASEDIR directories to avoid manual user interaction
for i in ${PKG_LIST}; do
mkdir -m 0755 -p ${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR` 2>/dev/null
done
#
# Check/Create installation directory
# Determine office installation directory
#
for i in ${PKG_LIST}; do
echo $i | grep core01 > /dev/null
if [ $? = 0 ]; then
INSTALL_DIR=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR`
mkdir -p ${INSTALL_DIR}
OFFICE_DIR=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR`
fi
done
@@ -217,21 +222,25 @@ fi
if [ "$LINK" = "yes" ]
then
echo
echo "Creating link from $INSTALL_DIR/program/soffice to $HOME/soffice"
echo "Creating link from $OFFICE_DIR/program/soffice to $HOME/soffice"
rm -f $HOME/soffice 2>/dev/null
ln -s $INSTALL_DIR/program/soffice $HOME/soffice
ln -s $OFFICE_DIR/program/soffice $HOME/soffice
fi
# patch the "bootstraprc" to create a self-containing installation
mv ${INSTALL_DIR}/program/bootstraprc ${INSTALL_DIR}/program/bootstraprc.orig
sed 's/UserInstallation=$SYSUSERCONFIG.*/UserInstallation=$ORIGIN\/..\/UserInstallation/g' \
${INSTALL_DIR}/program/bootstraprc.orig > ${INSTALL_DIR}/program/bootstraprc
if [ "${OFFICE_DIR}" != "" ]; then
mv ${OFFICE_DIR}/program/bootstraprc ${OFFICE_DIR}/program/bootstraprc.orig
sed 's/UserInstallation=$SYSUSERCONFIG.*/UserInstallation=$ORIGIN\/..\/UserInstallation/g' \
${OFFICE_DIR}/program/bootstraprc.orig > ${OFFICE_DIR}/program/bootstraprc
fi
# patch the LD_LIBRARY_PATH in the "soffice" script so that it finds a suitable libfreetype
mv ${INSTALL_DIR}/program/soffice ${INSTALL_DIR}/program/soffice.orig
sed 's| LD_LIBRARY_PATH=\"\$sd_prog\"| LD_LIBRARY_PATH=/usr/sfw/lib:"$sd_prog":"$sd_prog/../../../usr/sfw/lib"|' \
${INSTALL_DIR}/program/soffice.orig > ${INSTALL_DIR}/program/soffice
chmod a+x ${INSTALL_DIR}/program/soffice
if [ "${OFFICE_DIR}" != "" ]; then
mv ${OFFICE_DIR}/program/soffice ${OFFICE_DIR}/program/soffice.orig
sed 's| LD_LIBRARY_PATH=\"\$sd_prog\"| LD_LIBRARY_PATH=/usr/sfw/lib:"$sd_prog":"$sd_prog/../../../usr/sfw/lib"|' \
${OFFICE_DIR}/program/soffice.orig > ${OFFICE_DIR}/program/soffice
chmod a+x ${OFFICE_DIR}/program/soffice
fi
echo
echo "Installation done ..."