183dd286eSPedro Giffuni#!/usr/bin/env bash
29f22d7c2SAndrew Rist# *************************************************************
39f22d7c2SAndrew Rist#
49f22d7c2SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
59f22d7c2SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
69f22d7c2SAndrew Rist#  distributed with this work for additional information
79f22d7c2SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
89f22d7c2SAndrew Rist#  to you under the Apache License, Version 2.0 (the
99f22d7c2SAndrew Rist#  "License"); you may not use this file except in compliance
109f22d7c2SAndrew Rist#  with the License.  You may obtain a copy of the License at
119f22d7c2SAndrew Rist#
129f22d7c2SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
139f22d7c2SAndrew Rist#
149f22d7c2SAndrew Rist#  Unless required by applicable law or agreed to in writing,
159f22d7c2SAndrew Rist#  software distributed under the License is distributed on an
169f22d7c2SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
179f22d7c2SAndrew Rist#  KIND, either express or implied.  See the License for the
189f22d7c2SAndrew Rist#  specific language governing permissions and limitations
199f22d7c2SAndrew Rist#  under the License.
209f22d7c2SAndrew Rist#
219f22d7c2SAndrew Rist# *************************************************************
22cdf0e10cSrcweir
23cdf0e10cSrcweirADD="no"
24cdf0e10cSrcweirLINK="no"
25cdf0e10cSrcweirUPDATE="no"
26cdf0e10cSrcweirUSAGE="Usage: $0 [-a] [-l] [-h] <pkg-source-dir> <office-installation-dir>"
27cdf0e10cSrcweir
28cdf0e10cSrcweirhelp()
29cdf0e10cSrcweir{
30cdf0e10cSrcweir  echo
31cdf0e10cSrcweir  echo "User Mode Installation script for developer and knowledgeable early access tester"
32cdf0e10cSrcweir  echo
33cdf0e10cSrcweir  echo "This installation method is not intended for use in a production environment!"
34cdf0e10cSrcweir  echo "Using this script is unsupported and completely at your own risk"
35cdf0e10cSrcweir  echo
36cdf0e10cSrcweir  echo "Usage:" $0 "<pkg-source-dir> <office-installation-dir> [-l]"
37cdf0e10cSrcweir  echo "    <pkg-source-dir>:       directory *only* containing the Solaris pkg packages to be installed"
38cdf0e10cSrcweir  echo "                            or language pack shell script containing the Solaris pkg packages"
39cdf0e10cSrcweir  echo "    <office-installation-dir>: directory to where the office and the pkg database will get installed into"
40cdf0e10cSrcweir  echo
41cdf0e10cSrcweir  echo "Optional Parameter:"
42cdf0e10cSrcweir  echo "    -a :              add to an existing <office-installation-dir>"
43cdf0e10cSrcweir  echo "    -l :              create a link \"soffice\" in $HOME"
44cdf0e10cSrcweir  echo "    -h :              output this help"
45cdf0e10cSrcweir}
46cdf0e10cSrcweir
47cdf0e10cSrcweirtry_to_unpack_languagepack_file()
48cdf0e10cSrcweir{
49cdf0e10cSrcweir  FILENAME=$PACKAGE_PATH
50cdf0e10cSrcweir
51cdf0e10cSrcweir  # Checking, if $FILENAME is a language pack.
52cdf0e10cSrcweir  # String "language package" has to exist in the shell script file.
53cdf0e10cSrcweir  # If this is no language pack, the installation is not supported
54cdf0e10cSrcweir
55cdf0e10cSrcweir  SEARCHSTRING=`head -n 10 $FILENAME | grep "language package"`
56cdf0e10cSrcweir
57cdf0e10cSrcweir  if [ ! -z "$SEARCHSTRING" ]
58cdf0e10cSrcweir  then
59cdf0e10cSrcweir    echo "First parameter $FILENAME is a language pack";
60cdf0e10cSrcweir  else
61cdf0e10cSrcweir    printf "\nERROR: First parameter $FILENAME is a file, but no language pack shell script.\n"
62cdf0e10cSrcweir    echo $USAGE
63cdf0e10cSrcweir    exit 2
64cdf0e10cSrcweir  fi
65cdf0e10cSrcweir
66cdf0e10cSrcweir  echo "Unpacking shell script $FILENAME"
67cdf0e10cSrcweir  # TAILLINE=`head -n 20 $FILENAME | sed --quiet 's/linenum=//p'`
68cdf0e10cSrcweir  TAILLINE=`head -n 20 $FILENAME | sed -n 's/linenum=//p'`
69cdf0e10cSrcweir
70cdf0e10cSrcweir  if [ -x "/usr/bin/mktemp" ]  # available in Solaris 10
71cdf0e10cSrcweir  then
72cdf0e10cSrcweir    UNPACKDIR=`mktemp -d`
73cdf0e10cSrcweir  else
74cdf0e10cSrcweir    UNPACKDIR=/var/tmp/install_$$
75cdf0e10cSrcweir    mkdir $UNPACKDIR
76cdf0e10cSrcweir  fi
77cdf0e10cSrcweir
78cdf0e10cSrcweir  echo $UNPACKDIR
79cdf0e10cSrcweir  tail +$TAILLINE $FILENAME | gunzip | (cd $UNPACKDIR; tar xvf -)
80cdf0e10cSrcweir
81cdf0e10cSrcweir  # Setting the new package path, in which the packages exist
82cdf0e10cSrcweir  PACKAGE_PATH=$UNPACKDIR
83cdf0e10cSrcweir
84cdf0e10cSrcweir  # Setting variable UPDATE, because an Office installation has to exist, if a language pack shall be installed
85cdf0e10cSrcweir  UPDATE="yes"
86cdf0e10cSrcweir}
87cdf0e10cSrcweir
88cdf0e10cSrcweirpkg_error()
89cdf0e10cSrcweir{
90cdf0e10cSrcweir  # pkg command failed, check for admin log and report help
91cdf0e10cSrcweir  if [ -f /tmp/.ai.pkg.zone.lock-afdb66cf-1dd1-11b2-a049-000d560ddc3e ]
92cdf0e10cSrcweir  then
93cdf0e10cSrcweir    echo "####################################################################"
94cdf0e10cSrcweir    echo "#     Installation failed due to stale administrative lock         #"
95cdf0e10cSrcweir    echo "####################################################################"
96cdf0e10cSrcweir    printf "\nERROR: please remove the following file first:\n"
97cdf0e10cSrcweir	ls -l /tmp/.ai.pkg.zone.lock-afdb66cf-1dd1-11b2-a049-000d560ddc3e
98cdf0e10cSrcweir  fi
99cdf0e10cSrcweir  rm -f $GETUID_SO
100cdf0e10cSrcweir  exit 1
101cdf0e10cSrcweir}
102cdf0e10cSrcweir
103cdf0e10cSrcweirget_pkg_list()
104cdf0e10cSrcweir{
105cdf0e10cSrcweir  cd $1; ls -1
106cdf0e10cSrcweir}
107cdf0e10cSrcweir
108cdf0e10cSrcweir#
109cdf0e10cSrcweir# this script is for userland not for root
110cdf0e10cSrcweir#
111cdf0e10cSrcweir
112cdf0e10cSrcweirif [ $UID -eq 0 ]
113cdf0e10cSrcweirthen
114cdf0e10cSrcweir  printf "\nThis script is for installation without administrative rights only\nPlease use pkgadd/patchadd to install as root\n"
115cdf0e10cSrcweir  help
116cdf0e10cSrcweir  exit 2
117cdf0e10cSrcweirfi
118cdf0e10cSrcweir
119cdf0e10cSrcweirwhile getopts "alh" VALUE
120cdf0e10cSrcweirdo
121cdf0e10cSrcweir  echo $VALUE
122cdf0e10cSrcweir  case $VALUE in
123cdf0e10cSrcweir    a)      ADD="yes"; break;;
124cdf0e10cSrcweir    h)      help; exit 0;;
125cdf0e10cSrcweir    l)      LINK="yes"; break;;
126cdf0e10cSrcweir    ?)      echo $USAGE; exit 2;;
127cdf0e10cSrcweir  esac
128cdf0e10cSrcweirdone
129cdf0e10cSrcweirshift `expr $OPTIND - 1`
130cdf0e10cSrcweir
131cdf0e10cSrcweirif [ $# != 2 ]
132cdf0e10cSrcweirthen
133cdf0e10cSrcweir  echo $USAGE
134cdf0e10cSrcweir  exit 2
135cdf0e10cSrcweirfi
136cdf0e10cSrcweir
137cdf0e10cSrcweir# Determine whether this is a patch or a regular install set ..
138cdf0e10cSrcweir/bin/bash -c "ls $1/*/patchinfo >/dev/null 2>&1"
139cdf0e10cSrcweirif [ "$?" = 0 ]
140cdf0e10cSrcweirthen
141cdf0e10cSrcweir  UPDATE="yes"
142cdf0e10cSrcweir  PATCH_PATH="$1"
143cdf0e10cSrcweir  PATCH_INFO_LIST=`/bin/bash -c "cd $1; ls */patchinfo"`
144cdf0e10cSrcweir  PATCH_LIST=`for i in ${PATCH_INFO_LIST}; do dirname $i; done`
145cdf0e10cSrcweirelif [ -f "$1/patchinfo" ]
146cdf0e10cSrcweirthen
147cdf0e10cSrcweir  UPDATE="yes"
148cdf0e10cSrcweir  PATCH_PATH=`dirname "$1"`
149cdf0e10cSrcweir  PATCH_LIST=`basename "$1"`
150cdf0e10cSrcweirelse
151cdf0e10cSrcweir  if [ -d "$1/packages" ]
152cdf0e10cSrcweir  then
153cdf0e10cSrcweir    PACKAGE_PATH="$1/packages"
154cdf0e10cSrcweir  else
155cdf0e10cSrcweir    PACKAGE_PATH=$1
156cdf0e10cSrcweir  fi
157cdf0e10cSrcweir
158cdf0e10cSrcweir  #
159cdf0e10cSrcweir  # If the first parameter is a shell script (download installation set), the packages have to
160cdf0e10cSrcweir  # be unpacked into temp directory
161cdf0e10cSrcweir  #
162cdf0e10cSrcweir  if [ -f "$PACKAGE_PATH" ]
163cdf0e10cSrcweir  then
164cdf0e10cSrcweir    try_to_unpack_languagepack_file
165cdf0e10cSrcweir  fi
166cdf0e10cSrcweir
167cdf0e10cSrcweir  #
168cdf0e10cSrcweir  # Create sed filter script for unwanted packages
169cdf0e10cSrcweir  #
170cdf0e10cSrcweir
171cdf0e10cSrcweir  cat > /tmp/userinstall_filer.$$ << EOF
172cdf0e10cSrcweir/SUNWadabas/d
173cdf0e10cSrcweir/^SUNWj[0-9]/d
174cdf0e10cSrcweir/-desktop-int/d
175cdf0e10cSrcweir/-shared-mime-info/d
176cdf0e10cSrcweir/-cde/d
177cdf0e10cSrcweirEOF
178cdf0e10cSrcweir
179cdf0e10cSrcweir  # Do not install gnome-integration package on systems without GNOME
180cdf0e10cSrcweir  pkginfo -q SUNWgnome-vfs
181cdf0e10cSrcweir  if [ $? -ne 0 ]
182cdf0e10cSrcweir  then
183cdf0e10cSrcweir
184cdf0e10cSrcweir    echo '/-gnome/d' >> /tmp/userinstall_filer.$$
185cdf0e10cSrcweir  fi
186cdf0e10cSrcweir
187cdf0e10cSrcweir  # pkgdep sorts the packages based on their dependencies
188cdf0e10cSrcweir  PKGDEP="`dirname $0`/pkgdep"
189cdf0e10cSrcweir  if [ ! -x $PKGDEP ]; then
190cdf0e10cSrcweir    PKGDEP="get_pkg_list"
191cdf0e10cSrcweir  fi
192cdf0e10cSrcweir
193cdf0e10cSrcweir  #
194cdf0e10cSrcweir  # Get the list of packages to install
195cdf0e10cSrcweir  #
196cdf0e10cSrcweir
197cdf0e10cSrcweir  PKG_LIST=`$PKGDEP $PACKAGE_PATH | sed -f  /tmp/userinstall_filer.$$`
198cdf0e10cSrcweir  rm -f /tmp/userinstall_filer.$$
199cdf0e10cSrcweir
200cdf0e10cSrcweir  if [ -z "$PKG_LIST" ]
201cdf0e10cSrcweir  then
202cdf0e10cSrcweir    printf "\n$0: No packages found in $PACKAGE_PATH\n"
203cdf0e10cSrcweir    exit 2
204cdf0e10cSrcweir  fi
205cdf0e10cSrcweir
206cdf0e10cSrcweir  echo "Packages found:"
207cdf0e10cSrcweir  for i in $PKG_LIST ; do
208cdf0e10cSrcweir    echo $i
209cdf0e10cSrcweir  done
210cdf0e10cSrcweirfi
211cdf0e10cSrcweir
212cdf0e10cSrcweirINSTALL_ROOT=$2
213cdf0e10cSrcweirif [ "$UPDATE" = "yes" ]
214cdf0e10cSrcweirthen
215cdf0e10cSrcweir  if [ ! -d ${INSTALL_ROOT}/var/sadm/install/admin ]
216cdf0e10cSrcweir  then
217cdf0e10cSrcweir    printf "\n$0: No package database in ${INSTALL_ROOT}.\n"
218cdf0e10cSrcweir    exit 2
219cdf0e10cSrcweir  fi
220cdf0e10cSrcweirelse
221cdf0e10cSrcweir  if [ "$ADD" = "no" ]
222cdf0e10cSrcweir  then
223cdf0e10cSrcweir    rmdir ${INSTALL_ROOT} 2>/dev/null
224cdf0e10cSrcweir    if [ -d ${INSTALL_ROOT} ]
225cdf0e10cSrcweir    then
226cdf0e10cSrcweir      printf "\n$0: ${INSTALL_ROOT} exists and is not empty.\n"
227cdf0e10cSrcweir      exit 2
228cdf0e10cSrcweir    fi
229cdf0e10cSrcweir  fi
230cdf0e10cSrcweir  mkdir -p ${INSTALL_ROOT}/var/sadm/install/admin
231cdf0e10cSrcweirfi
232cdf0e10cSrcweir
233cdf0e10cSrcweir# Previous versions of this script did not write this file
234cdf0e10cSrcweirif [ ! -f ${INSTALL_ROOT}/var/sadm/install/admin/default ]
235cdf0e10cSrcweirthen
236cdf0e10cSrcweir  cat > ${INSTALL_ROOT}/var/sadm/install/admin/default << EOF
237cdf0e10cSrcweiraction=nocheck
238cdf0e10cSrcweirconflict=nocheck
239cdf0e10cSrcweirsetuid=nocheck
240cdf0e10cSrcweiridepend=nocheck
241cdf0e10cSrcweirmail=
242cdf0e10cSrcweirEOF
243cdf0e10cSrcweirfi
244cdf0e10cSrcweir
245cdf0e10cSrcweirif [ ! "${INSTALL_ROOT:0:1}" = "/" ]; then
246cdf0e10cSrcweir  INSTALL_ROOT=`cd ${INSTALL_ROOT}; pwd`
247cdf0e10cSrcweirfi
248cdf0e10cSrcweir
249cdf0e10cSrcweir# This script must exist to make extension registration work
250cdf0e10cSrcweir# always overwrite to get the latest version.
251cdf0e10cSrcweirmkdir -p ${INSTALL_ROOT}/usr/lib
252cdf0e10cSrcweircat > ${INSTALL_ROOT}/usr/lib/postrun << \EOF
253cdf0e10cSrcweir#!/bin/sh
254cdf0e10cSrcweirset -e
255cdf0e10cSrcweir
256cdf0e10cSrcweir# Override UserInstallation in bootstraprc for unopkg ..
257*910823aeSJürgen SchmidtUserInstallation='$OOO_BASE_DIR/../UserInstallation'
258cdf0e10cSrcweirexport UserInstallation
259cdf0e10cSrcweir
260cdf0e10cSrcweirif [ -x /usr/bin/mktemp ]
261cdf0e10cSrcweirthen
262cdf0e10cSrcweir  CMD=`/usr/bin/mktemp /tmp/userinstall.XXXXXX`
263cdf0e10cSrcweirelse
264cdf0e10cSrcweir  CMD=/tmp/userinstall.$$; echo "" > $CMD
265cdf0e10cSrcweirfi
266cdf0e10cSrcweir
267cdf0e10cSrcweirsed -e 's|/opt/|${PKG_INSTALL_ROOT}/opt/|g' > $CMD
268cdf0e10cSrcweir/bin/sh -e $CMD
269cdf0e10cSrcweirrm -f $CMD
270cdf0e10cSrcweirEOF
271cdf0e10cSrcweirchmod +x ${INSTALL_ROOT}/usr/lib/postrun 2>/dev/null
272cdf0e10cSrcweir
273cdf0e10cSrcweir# create local tmp directory to install on S10
274cdf0e10cSrcweirLOCAL_TMP=
275cdf0e10cSrcweirif [ -x /usr/bin/mktemp ]
276cdf0e10cSrcweirthen
277cdf0e10cSrcweir  LOCAL_TMP=`mktemp -d`
278cdf0e10cSrcweir  rmdir ${INSTALL_ROOT}/tmp 2>/dev/null
279cdf0e10cSrcweir  ln -s ${LOCAL_TMP} ${INSTALL_ROOT}/tmp
280cdf0e10cSrcweirfi
281cdf0e10cSrcweir
282cdf0e10cSrcweir#
283cdf0e10cSrcweir# the tail of the script contains a shared object for overloading the getuid()
284cdf0e10cSrcweir# and a few other calls
285cdf0e10cSrcweir#
286cdf0e10cSrcweir
287cdf0e10cSrcweirGETUID_SO=/tmp/getuid.so.$$
288cdf0e10cSrcweirlinenum=???
289cdf0e10cSrcweirtail +$linenum $0 > $GETUID_SO
290cdf0e10cSrcweir
291cdf0e10cSrcweir#
292cdf0e10cSrcweir# Perform the installation
293cdf0e10cSrcweir#
294cdf0e10cSrcweirif [ "$UPDATE" = "yes" ]
295cdf0e10cSrcweirthen
296cdf0e10cSrcweir  # restore original "bootstraprc" prior to patching
297cdf0e10cSrcweir  for i in ${PKG_LIST}; do
298cdf0e10cSrcweir    my_dir=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} "$i" BASEDIR`
299cdf0e10cSrcweir    find "$my_dir" -type f -name bootstraprc.orig -exec sh -ce 'mv "$0" `dirname "$0"`/bootstraprc' {} \;
300cdf0e10cSrcweir  done
301cdf0e10cSrcweir
302cdf0e10cSrcweir  # copy INST_RELEASE file
303cdf0e10cSrcweir  if [ ! -f ${INSTALL_ROOT}/var/sadm/system/admin/INST_RELEASE ]
304cdf0e10cSrcweir  then
305cdf0e10cSrcweir    mkdir -p ${INSTALL_ROOT}/var/sadm/system/admin 2>/dev/null
306cdf0e10cSrcweir    cp -f /var/sadm/system/admin/INST_RELEASE ${INSTALL_ROOT}/var/sadm/system/admin/INST_RELEASE
307cdf0e10cSrcweir  fi
308cdf0e10cSrcweir
309cdf0e10cSrcweir  # The case UPDATE="yes" is valid for patch installation and for language packs.
310cdf0e10cSrcweir  # For patches the variable PKG_LIST is empty, for language packs it is not empty.
311cdf0e10cSrcweir  # Patches have to be installed with patchadd, language packs with pkgadd
312cdf0e10cSrcweir
313cdf0e10cSrcweir  if [ -z "${PKG_LIST}" ]
314cdf0e10cSrcweir  then
315cdf0e10cSrcweir    LD_PRELOAD_32=$GETUID_SO /usr/sbin/patchadd -R ${INSTALL_ROOT} -M ${PATCH_PATH} ${PATCH_LIST} 2>&1 | grep -v '/var/sadm/patch' || pkg_error
316cdf0e10cSrcweir  else
317cdf0e10cSrcweir    LD_PRELOAD_32=$GETUID_SO /usr/sbin/pkgadd -d ${PACKAGE_PATH} -R ${INSTALL_ROOT} ${PKG_LIST} >/dev/null || pkg_error
318cdf0e10cSrcweir  fi
319cdf0e10cSrcweir
320cdf0e10cSrcweirelse
321cdf0e10cSrcweir
322cdf0e10cSrcweir  # Create BASEDIR directories to avoid manual user interaction
323cdf0e10cSrcweir  for i in ${PKG_LIST}; do
324cdf0e10cSrcweir    mkdir -m 0755 -p ${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR` 2>/dev/null
325cdf0e10cSrcweir  done
326cdf0e10cSrcweir
327cdf0e10cSrcweir  if [ ! "${INSTALL_ROOT:0:1}" = "/" ]; then
328cdf0e10cSrcweir    INSTALL_ROOT=`cd ${INSTALL_ROOT}; pwd`
329cdf0e10cSrcweir  fi
330cdf0e10cSrcweir
331cdf0e10cSrcweir  echo "####################################################################"
332cdf0e10cSrcweir  echo "#     Installation of the found packages                           #"
333cdf0e10cSrcweir  echo "####################################################################"
334cdf0e10cSrcweir  echo
335cdf0e10cSrcweir  echo "Path to the packages       : " $PACKAGE_PATH
336cdf0e10cSrcweir  echo "Path to the installation   : " $INSTALL_ROOT
337cdf0e10cSrcweir
338cdf0e10cSrcweir  LD_PRELOAD_32=$GETUID_SO /usr/sbin/pkgadd -d ${PACKAGE_PATH} -R ${INSTALL_ROOT} ${PKG_LIST} >/dev/null || pkg_error
339cdf0e10cSrcweirfi
340cdf0e10cSrcweir
341cdf0e10cSrcweirrm -f $GETUID_SO
342cdf0e10cSrcweirrm -f /tmp/.ai.pkg.zone.lock*
343cdf0e10cSrcweir
344cdf0e10cSrcweir# remove local tmp directory
345cdf0e10cSrcweirif [ ! -z ${LOCAL_TMP} ]
346cdf0e10cSrcweirthen
347cdf0e10cSrcweir  rm -f ${LOCAL_TMP}/.ai.pkg.zone.lock*
348cdf0e10cSrcweir  rmdir ${LOCAL_TMP}
349cdf0e10cSrcweir  rm -f ${INSTALL_ROOT}/tmp
350cdf0e10cSrcweir  mkdir ${INSTALL_ROOT}/tmp
351cdf0e10cSrcweirfi
352cdf0e10cSrcweir
353cdf0e10cSrcweir#
354cdf0e10cSrcweir# Create a link into the users home directory
355cdf0e10cSrcweir#
356cdf0e10cSrcweir
357cdf0e10cSrcweirif [ "$LINK" = "yes" ]
358cdf0e10cSrcweirthen
359cdf0e10cSrcweir  rm -f $HOME/soffice 2>/dev/null
360cdf0e10cSrcweir  find `cd "$INSTALL_ROOT" && pwd` -name soffice -type f -perm -u+x -exec /bin/sh -ce 'ln -sf "$0" "$HOME/soffice" && echo "Creating link from $0 to $HOME/soffice"' {} \;
361cdf0e10cSrcweirfi
362cdf0e10cSrcweir
363cdf0e10cSrcweir# patch the "bootstraprc" to create a self-containing installation
364cdf0e10cSrcweirfor i in ${PKG_LIST}; do
365cdf0e10cSrcweir  my_dir=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} "$i" BASEDIR`
366*910823aeSJürgen Schmidt  find "$my_dir" -type f -name bootstraprc -exec sh -ce 'test ! -f "$0".orig && mv "$0" "$0".orig && sed '\''s,^UserInstallation=$SYSUSERCONFIG.*,UserInstallation=$OOO_BASE_DIR/../UserInstallation,'\'' "$0".orig > "$0"' {} \;
367cdf0e10cSrcweirdone
368cdf0e10cSrcweir
369cdf0e10cSrcweir# if an unpack directory exists, it can be removed now
370cdf0e10cSrcweirif [ ! -z "$UNPACKDIR" ]
371cdf0e10cSrcweirthen
372cdf0e10cSrcweir  # for i in ${PKG_LIST}; do
373cdf0e10cSrcweir  #   cd $UNPACKDIR; rm -rf $i
374cdf0e10cSrcweir  # done
375cdf0e10cSrcweir  # rmdir $UNPACKDIR
376cdf0e10cSrcweir
377cdf0e10cSrcweir  rm -rf $UNPACKDIR
378cdf0e10cSrcweir  echo "Removed temporary directory $UNPACKDIR"
379cdf0e10cSrcweirfi
380cdf0e10cSrcweir
381cdf0e10cSrcweirecho
382cdf0e10cSrcweirecho "Installation done ..."
383cdf0e10cSrcweirexit 0
384cdf0e10cSrcweir
385