3 MYUID
=`id | sed "s/(.*//g" | sed "s/.*=//"`
7 echo You need to have super-user permissions to run this
patch script
12 echo "Searching for the PRODUCTNAMEPLACEHOLDER installation ..."
14 RPMNAME
=`rpm -qa | grep SEARCHPACKAGENAMEPLACEHOLDER`
16 if [ "x$RPMNAME" != "x" ]
18 PRODUCTINSTALLLOCATION
="`rpm --query --queryformat "%{INSTALLPREFIX
}" $RPMNAME`"
19 FULLPRODUCTINSTALLLOCATION
="${PRODUCTINSTALLLOCATION}/PRODUCTDIRECTORYNAME"
21 echo "PRODUCTNAMEPLACEHOLDER is not installed"
25 # Last chance to exit ..
27 read -p "Patching the installation in ${FULLPRODUCTINSTALLLOCATION}. Continue (y/n) ? " -n 1 reply leftover
29 [ "$reply" == "y" ] ||
exit 1
32 echo "About to update the following packages ..."
37 for i
in `ls $BASEDIR/RPMS/*.rpm`
39 rpm
--query `rpm --query --queryformat "%{NAME}\n" --package $i` && RPMLIST
="$RPMLIST $i"
42 # Save UserInstallation value
43 BOOTSTRAPRC
="${FULLPRODUCTINSTALLLOCATION}/program/bootstraprc"
44 USERINST
=`grep UserInstallation ${BOOTSTRAPRC}`
46 # Check, if kde-integration rpm is available
47 KDERPM
=`ls $BASEDIR/RPMS/*.rpm | grep kde-integration`
49 if [ "x$KDERPM" != "x" ]; then
50 # Check, that $RPMLIST does not contain kde integration rpm (then it is already installed)
51 KDERPMINSTALLED
=`grep kde-integration ${RPMLIST}`
53 if [ "x$KDERPMINSTALLED" == "x" ]; then
54 # Install the kde integration rpm
55 RPMLIST
="$RPMLIST $KDERPM"
60 rpm
--upgrade -v --hash --prefix $PRODUCTINSTALLLOCATION --notriggers $RPMLIST
63 # Some RPM versions have problems with -U and --prefix
64 if [ ! -f ${BOOTSTRAPRC} ]; then
65 echo Update failed due to a bug
in RPM
, uninstalling ..
66 rpm
--erase -v --nodeps --notriggers `rpm --query --queryformat "%{NAME} " --package $RPMLIST`
68 echo Now re-installing new packages ..
70 rpm
--install -v --hash --prefix $PRODUCTINSTALLLOCATION --notriggers $RPMLIST
74 # Restore the UserInstallation key if necessary
75 DEFUSERINST
=`grep UserInstallation ${BOOTSTRAPRC}`
76 if [ "${USERINST}" != "${DEFUSERINST}" ]; then
77 mv -f ${BOOTSTRAPRC} ${BOOTSTRAPRC}.$$
78 sed "s|UserInstallation.*|${USERINST}|" ${BOOTSTRAPRC}.$$ > ${BOOTSTRAPRC}
79 rm -f ${BOOTSTRAPRC}.$$