1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

installCDE.src: Fix shellcheck warnings

This commit is contained in:
chase 2018-08-07 19:43:15 -05:00 committed by Jon Trulson
parent 66db2259f7
commit ff17b57585

View file

@ -50,8 +50,6 @@ unset FIGNORE
LOGFILE="installCDE.$$.log" LOGFILE="installCDE.$$.log"
REVISION="$(echo "$Revision: /main/20 $" | awk '{print $2}')"
Log() Log()
{ {
/bin/echo "$1" | tee -a $LOGFILE /bin/echo "$1" | tee -a $LOGFILE
@ -66,19 +64,19 @@ MakeTarball()
Log "Creating tarball..." Log "Creating tarball..."
DIRNAME=build.$DATE DIRNAME=build.$DATE
mkdir -p $TARBALL_LOCATION/$DIRNAME mkdir -p "$TARBALL_LOCATION/$DIRNAME"
cd / cd / || exit 1
echo $DATE >$LOGFILES_LOCATION/.build.$DATE echo "$DATE" >"$LOGFILES_LOCATION/.build.$DATE"
chown bin $LOGFILES_LOCATION/.build.$DATE chown bin "$LOGFILES_LOCATION/.build.$DATE"
if [ "$COMPRESS_TARBALL" = "yes" ]; then if [ "$COMPRESS_TARBALL" = "yes" ]; then
tar -cf - $INSTALL_LOCATION/STAR \ tar -cf - "$INSTALL_LOCATION/STAR" \
2>$TARBALL_LOCATION/$DIRNAME/extract.err | 2>"$TARBALL_LOCATION/$DIRNAME/extract.err" |
compress -c >$TARBALL_LOCATION/$DIRNAME/dttar.Z compress -c >"$TARBALL_LOCATION/$DIRNAME/dttar.Z"
else else
tar -cf $TARBALL_LOCATION/$DIRNAME/dt.tar \ tar -cf "$TARBALL_LOCATION/$DIRNAME/dt.tar" \
$INSTALL_LOCATION/STAR \ "$INSTALL_LOCATION/STAR" \
2>$TARBALL_LOCATION/$DIRNAME/extract.err 2>&1 2>"$TARBALL_LOCATION/$DIRNAME/extract.err" 2>&1
fi fi
if [ "$ACTUAL_INSTALLATION_LOC" = "" ]; then if [ "$ACTUAL_INSTALLATION_LOC" = "" ]; then
@ -86,31 +84,30 @@ MakeTarball()
else else
actualInstallDir=$ACTUAL_INSTALLATION_LOC actualInstallDir=$ACTUAL_INSTALLATION_LOC
fi fi
let size=$(du -s $actualInstallDir | awk '{print $1}')*512 let size=$(du -s "$actualInstallDir" | awk '{print $1}')*512
HASH load installation fileset *after* tarball generated HASH load installation fileset *after* tarball generated
LoadFileSet "" "CDE-INSTALL" LoadFileSet "" "CDE-INSTALL"
HASH create config dir HASH create config dir
destPost=$TARBALL_LOCATION/$DIRNAME/config destPost=$TARBALL_LOCATION/$DIRNAME/config
mkdir $destPost mkdir "$destPost"
HASH copy config and platform config scripts HASH copy config and platform config scripts
src=$INSTALL_LOCATION/install/$PLATFORM_SCRIPT_DIR src=$INSTALL_LOCATION/install/$PLATFORM_SCRIPT_DIR
cp $src/config/STAR.cfg $destPost cp "$src/config/STAR.cfg" "$destPost"
HASH copy this script and install.dt platform overrides HASH copy this script and install.dt platform overrides
cp $src/install.dto $TARBALL_LOCATION/$DIRNAME/install.dto cp "$src/install.dto" "$TARBALL_LOCATION/$DIRNAME/install.dto"
cp $src/install.cde $TARBALL_LOCATION/$DIRNAME/install.cde cp "$src/install.cde" "$TARBALL_LOCATION/$DIRNAME/install.cde"
chmod 755 $TARBALL_LOCATION/$DIRNAME/install.cde chmod 755 "$TARBALL_LOCATION/$DIRNAME/install.cde"
cd / cd / || exit 1
Log "done." Log "done."
cat >$TARBALL_LOCATION/$DIRNAME/dt.pkg <<FIN cat >"$TARBALL_LOCATION/$DIRNAME/dt.pkg" <<FIN
PLATFORM: $PLATFORM PLATFORM: $PLATFORM
VERSION: $REVISION
TS: $DATE TS: $DATE
COMPRESSED: $COMPRESS_TARBALL COMPRESSED: $COMPRESS_TARBALL
SIZE: $size SIZE: $size
@ -118,7 +115,7 @@ CL: $ORIGINAL_COMMAND_LINE
FILESETS: $DATABASE_FILES FILESETS: $DATABASE_FILES
FIN FIN
cat >$TARBALL_LOCATION/$DIRNAME/build.status <<FIN cat >"$TARBALL_LOCATION/$DIRNAME/build.status" <<FIN
The UNIX Desktop The UNIX Desktop
BUILD: $DATE BUILD: $DATE
@ -128,7 +125,7 @@ MAJOR PROBLEMS: <not yet tested>
FIN FIN
chmod g+w $TARBALL_LOCATION/$DIRNAME/build.status chmod g+w "$TARBALL_LOCATION/$DIRNAME/build.status"
} }
DoFilesetScript() DoFilesetScript()
@ -142,22 +139,22 @@ DoFilesetScript()
ScriptName=$2 # use long config file name (configFoo) ScriptName=$2 # use long config file name (configFoo)
fi fi
if [ $CDECONFIGDIR = "CONFIG" ]; then if [ "$CDECONFIGDIR" = "CONFIG" ]; then
typeset -u ScriptName typeset -u ScriptName
fi fi
test_string=${DATABASE_FILES#*$FilesetName} test_string=${DATABASE_FILES#*$FilesetName}
if (( ${#DATABASE_FILES} > ${#test_string} )) if (( ${#DATABASE_FILES} > ${#test_string} ))
then then
if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ] if [ -x "$POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName" ]
then then
Log "Executing $PLATFORM specific $FilesetName customize script" Log "Executing $PLATFORM specific $FilesetName customize script"
KORNSHELL $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -e 2>&1 | \ KORNSHELL "$POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName" -e 2>&1 | \
tee -a $LOGFILE tee -a $LOGFILE
elif [ -x $POST_INSTALL_DIR/$ScriptName ] elif [ -x "$POST_INSTALL_DIR/$ScriptName" ]
then then
Log "Executing $FilesetName customize script" Log "Executing $FilesetName customize script"
KORNSHELL $POST_INSTALL_DIR/$ScriptName -e 2>&1 | tee -a $LOGFILE KORNSHELL "$POST_INSTALL_DIR/$ScriptName" -e 2>&1 | tee -a $LOGFILE
fi fi
fi fi
} }
@ -176,16 +173,16 @@ CreatePackingList()
{ {
Log " " Log " "
Log "Creating packing list." Log "Creating packing list."
touch $INSTALL_LOCATION/Packing_list touch "$INSTALL_LOCATION/Packing_list"
for i in `echo $DATABASE_FILES` for i in $DATABASE_FILES
do do
Log " for $i" Log " for $i"
KORNSHELL $TOOL_DIR/udbToAny.ksh -toDB -ReleaseStream $PLATFORM $DATABASE_DIR/${i}.udb > /tmp/${i}.db KORNSHELL "$TOOL_DIR/udbToAny.ksh" -toDB -ReleaseStream "$PLATFORM" "$DATABASE_DIR/${i}.udb" > "/tmp/${i}.db"
if [ -r /tmp/${i}.db ] if [ -r "/tmp/${i}.db" ]
then then
for file in `fgrep install_target /tmp/${i}.db | cut -sf 2 -d \: ` grep -F install_target "/tmp/${i}.db" | cut -sf 2 -d '\: ' < file | while IFS= read -r line
do do
echo "$file" >>$INSTALL_LOCATION/Packing_list echo "$line" >>"$INSTALL_LOCATION/Packing_list"
done done
fi fi
done done
@ -198,23 +195,23 @@ CleanDaemons()
for i in inetd rpc.ttdbserver rpc.cmsd for i in inetd rpc.ttdbserver rpc.cmsd
do do
if [ "$PLATFORM" = "aix" -a $i = "inetd" ] if [ "$PLATFORM" = "aix" ] && [ $i = "inetd" ]
then then
lssrc -s inetd >/dev/null 2>&1 if ! lssrc -s inetd >/dev/null 2>&1
if [ $? = "0" ]
then then
stopsrc -s inetd >>$LOGFILE 2>&1 stopsrc -s inetd >>$LOGFILE 2>&1
fi fi
elif [ "$PLATFORM" = "openbsd" -o "$PLATFORM" = "freebsd" -o "$PLATFORM" = "netbsd" -o "$PLATFORM" = "linux" ] elif [ "$PLATFORM" = "openbsd" ] || [ "$PLATFORM" = "freebsd" ] || \
[ "$PLATFORM" = "netbsd" ] || [ "$PLATFORM" = "linux" ]
then then
ps axo pid,comm | grep $i > /tmp/tmppsout pgrep pid,comm > /tmp/tmppsout
if [ -s /tmp/tmppsout ] if [ -s /tmp/tmppsout ]
then then
awk '{print "kill " $1}' /tmp/tmppsout | /bin/sh -f awk '{print "kill " $1}' /tmp/tmppsout | /bin/sh -f
sleep 2 sleep 2
fi fi
else else
ps -ef | grep $i | grep -v grep >/tmp/tmppsout pgrep -v pgrep >/tmp/tmppsout
if [ -s /tmp/tmppsout ] if [ -s /tmp/tmppsout ]
then then
awk '{print "kill " $2}' /tmp/tmppsout | /bin/sh -f awk '{print "kill " $2}' /tmp/tmppsout | /bin/sh -f
@ -229,8 +226,8 @@ RestartInetd()
{ {
HASH now restart inetd HASH now restart inetd
OLDPWD=`pwd` OLDPWD=$(pwd)
cd / cd / || exit 1
if [ "$PLATFORM" = "sun" ] if [ "$PLATFORM" = "sun" ]
then then
/usr/sbin/svcadm refresh svc:/network/inetd:default /usr/sbin/svcadm refresh svc:/network/inetd:default
@ -238,7 +235,7 @@ RestartInetd()
elif [ "$PLATFORM" = "aix" ] elif [ "$PLATFORM" = "aix" ]
then then
startsrc -s inetd >>$LOGFILE 2>&1 startsrc -s inetd >>$LOGFILE 2>&1
elif [ "$PLATFORM" = "openbsd" -o "$PLATFORM" = "netbsd" ] elif [ "$PLATFORM" = "openbsd" ] || [ "$PLATFORM" = "netbsd" ]
then then
/etc/rc.d/inetd start >/dev/null /etc/rc.d/inetd start >/dev/null
elif [ "$PLATFORM" = "freebsd" ] elif [ "$PLATFORM" = "freebsd" ]
@ -254,7 +251,7 @@ RestartInetd()
/etc/inetd /etc/inetd
#endif #endif
fi fi
cd $OLDPWD cd "$OLDPWD" || exit 1
} }
CheckForActualLocations() CheckForActualLocations()
@ -275,21 +272,21 @@ XCOMM
if [ "$CLEANING" = "yes" ] if [ "$CLEANING" = "yes" ]
then then
Log "Removing $INSTALL_LOCATION contents... " Log "Removing $INSTALL_LOCATION contents... "
if [ -d $INSTALL_LOCATION ] if [ -d "$INSTALL_LOCATION" ]
then then
rm -rf $INSTALL_LOCATION/STAR rm -rf "${INSTALL_LOCATION:?}/"STAR
if [ "$LeaveLinks" = "yes" ] if [ "$LeaveLinks" = "yes" ]
then then
if [ ! -L $INSTALL_LOCATION ] if [ ! -L "$INSTALL_LOCATION" ]
then then
rm -rf $INSTALL_LOCATION rm -rf "$INSTALL_LOCATION"
fi fi
else else
if [ -L $INSTALL_LOCATION ] if [ -L "$INSTALL_LOCATION" ]
then then
rm -f $INSTALL_LOCATION rm -f "$INSTALL_LOCATION"
else else
rm -rf $INSTALL_LOCATION rm -rf "$INSTALL_LOCATION"
fi fi
fi fi
fi fi
@ -304,22 +301,22 @@ XCOMM
HASH first create the actual directory - if not there HASH first create the actual directory - if not there
HASH HASH
if [ ! -d $ACTUAL_INSTALLATION_LOC ] if [ ! -d "$ACTUAL_INSTALLATION_LOC" ]
then then
mkdir -p $ACTUAL_INSTALLATION_LOC mkdir -p "$ACTUAL_INSTALLATION_LOC"
if [ ! -d $ACTUAL_INSTALLATION_LOC ] if [ ! -d "$ACTUAL_INSTALLATION_LOC" ]
then then
Log "cannot create $ACTUAL_INSTALLATION_LOC directory" Log "cannot create $ACTUAL_INSTALLATION_LOC directory"
exit 1 exit 1
fi fi
fi fi
ln -s $ACTUAL_INSTALLATION_LOC $INSTALL_LOCATION ln -s "$ACTUAL_INSTALLATION_LOC" "$INSTALL_LOCATION"
else else
if [ ! -d $INSTALL_LOCATION -a ! -L $INSTALL_LOCATION ]; if [ ! -d "$INSTALL_LOCATION" ] && [ ! -L "$INSTALL_LOCATION" ];
then then
mkdir -p $INSTALL_LOCATION mkdir -p "$INSTALL_LOCATION"
fi fi
fi fi
fi fi
@ -334,21 +331,21 @@ XCOMM
if [ "$CLEANING_ETC" = "yes" ] if [ "$CLEANING_ETC" = "yes" ]
then then
Log "Removing $CONFIGURE_LOCATION contents... " Log "Removing $CONFIGURE_LOCATION contents... "
if [ -d $CONFIGURE_LOCATION ] if [ -d "$CONFIGURE_LOCATION" ]
then then
rm -rf $CONFIGURE_LOCATION/STAR rm -rf "${CONFIGURE_LOCATION:?}/"STAR
if [ "$LeaveLinks" = "yes" ] if [ "$LeaveLinks" = "yes" ]
then then
if [ ! -L $CONFIGURE_LOCATION ] if [ ! -L "$CONFIGURE_LOCATION" ]
then then
rm -rf $CONFIGURE_LOCATION rm -rf "$CONFIGURE_LOCATION"
fi fi
else else
if [ -L $CONFIGURE_LOCATION ] if [ -L "$CONFIGURE_LOCATION" ]
then then
rm -f $CONFIGURE_LOCATION rm -f "$CONFIGURE_LOCATION"
else else
rm -rf $CONFIGURE_LOCATION rm -rf "$CONFIGURE_LOCATION"
fi fi
fi fi
fi fi
@ -356,43 +353,43 @@ XCOMM
if [ "$ACTUAL_CONFIGURATION_LOC" != "" ] if [ "$ACTUAL_CONFIGURATION_LOC" != "" ]
then then
if [ ! -d $ACTUAL_CONFIGURATION_LOC ] if [ ! -d "$ACTUAL_CONFIGURATION_LOC" ]
then then
mkdir -p $ACTUAL_CONFIGURATION_LOC mkdir -p "$ACTUAL_CONFIGURATION_LOC"
if [ ! -d $ACTUAL_CONFIGURATION_LOC ] if [ ! -d "$ACTUAL_CONFIGURATION_LOC" ]
then then
Log "cannot create $ACTUAL_CONFIGURATION_LOC directory" Log "cannot create $ACTUAL_CONFIGURATION_LOC directory"
exit 1 exit 1
fi fi
fi fi
ln -s $ACTUAL_CONFIGURATION_LOC $CONFIGURE_LOCATION ln -s "$ACTUAL_CONFIGURATION_LOC" "$CONFIGURE_LOCATION"
else else
if [ ! -d $CONFIGURE_LOCATION -a ! -L $CONFIGURE_LOCATION ]; if [ ! -d "$CONFIGURE_LOCATION" ] && [ ! -L "$CONFIGURE_LOCATION" ];
then then
mkdir -p $CONFIGURE_LOCATION mkdir -p "$CONFIGURE_LOCATION"
fi fi
fi fi
if [ "$CLEANING" = "yes" ] if [ "$CLEANING" = "yes" ]
then then
Log "Removing $LOGFILES_LOCATION contents... " Log "Removing $LOGFILES_LOCATION contents... "
if [ -d $LOGFILES_LOCATION ] if [ -d "$LOGFILES_LOCATION" ]
then then
rm -rf $LOGFILES_LOCATION/STAR rm -rf "${LOGFILES_LOCATION:?}/"STAR
if [ "$LeaveLinks" = "yes" ] if [ "$LeaveLinks" = "yes" ]
then then
if [ ! -L $LOGFILES_LOCATION ] if [ ! -L "$LOGFILES_LOCATION" ]
then then
rm -rf $LOGFILES_LOCATION rm -rf "$LOGFILES_LOCATION"
fi fi
else else
if [ -L $LOGFILES_LOCATION ] if [ -L "$LOGFILES_LOCATION" ]
then then
rm -f $LOGFILES_LOCATION rm -f "$LOGFILES_LOCATION"
else else
rm -rf $LOGFILES_LOCATION rm -rf "$LOGFILES_LOCATION"
fi fi
fi fi
fi fi
@ -400,22 +397,22 @@ XCOMM
if [ "$ACTUAL_VAR_LOC" != "" ] if [ "$ACTUAL_VAR_LOC" != "" ]
then then
if [ ! -d $ACTUAL_VAR_LOC ] if [ ! -d "$ACTUAL_VAR_LOC" ]
then then
mkdir -p $ACTUAL_VAR_LOC mkdir -p "$ACTUAL_VAR_LOC"
if [ ! -d $ACTUAL_VAR_LOC ] if [ ! -d "$ACTUAL_VAR_LOC" ]
then then
Log "cannot create $ACTUAL_VAR_LOC directory" Log "cannot create $ACTUAL_VAR_LOC directory"
exit 1 exit 1
fi fi
fi fi
ln -s $ACTUAL_VAR_LOC $LOGFILES_LOCATION ln -s "$ACTUAL_VAR_LOC" "$LOGFILES_LOCATION"
else else
if [ ! -d $LOGFILES_LOCATION -a ! -L $LOGFILES_LOCATION ]; if [ ! -d "$LOGFILES_LOCATION" ] && [ ! -L "$LOGFILES_LOCATION" ];
then then
mkdir -p $LOGFILES_LOCATION mkdir -p "$LOGFILES_LOCATION"
fi fi
fi fi
@ -424,7 +421,7 @@ XCOMM
USAGE() USAGE()
{ {
echo -e "Usage: $(basename $0) {-s <source>|-z <package>} [options]" echo -e "Usage: $(basename "$0") {-s <source>|-z <package>} [options]"
echo -e "" echo -e ""
echo -e "\t-s <source>\t\t\tthe top of the build tree" echo -e "\t-s <source>\t\t\tthe top of the build tree"
echo -e "\t-z <package>\t\tthe desktop install package" echo -e "\t-z <package>\t\tthe desktop install package"
@ -491,28 +488,28 @@ LoadFileSet()
fi fi
XCOMM don't bother if the fileset doesn't exist XCOMM don't bother if the fileset doesn't exist
if [ ! -e $DATABASE_DIR/${2}.udb ] if [ ! -e "$DATABASE_DIR/${2}.udb" ]
then then
return return
fi fi
Log " $num installing database $2" Log " $num installing database $2"
Log " - creating ${2}.lst file" Log " - creating ${2}.lst file"
KORNSHELL $TOOL_DIR/udbToAny.ksh -toLst -ReleaseStream $PLATFORM \ KORNSHELL "$TOOL_DIR/udbToAny.ksh" -toLst -ReleaseStream "$PLATFORM" \
$DATABASE_DIR/${2}.udb > /tmp/${2}.lst "$DATABASE_DIR/${2}.udb" > "/tmp/${2}.lst"
Log " - installing ... " Log " - installing ... "
KORNSHELL $TOOL_DIR/mkProd -D $DESTINATION_DIR -S $BUILD_TREE /tmp/${2}.lst \ KORNSHELL "$TOOL_DIR/mkProd" -D "$DESTINATION_DIR" -S "$BUILD_TREE" "/tmp/${2}.lst" \
2>/tmp/${2}.err 1>/tmp/${2}.good 2>"/tmp/${2}.err" 1>"/tmp/${2}.good"
Log " done." Log " done."
Log " - checking for errors ..." Log " - checking for errors ..."
rm -f /tmp/${2}.missing rm -f "/tmp/${2}.missing"
awk '{if ($1 == "ERROR:") print " " $4}' \ awk '{if ($1 == "ERROR:") print " " $4}' \
/tmp/${2}.err >> /tmp/${2}.missing "/tmp/${2}.err" >> "/tmp/${2}.missing"
if [ -s /tmp/${2}.missing ] if [ -s "/tmp/${2}.missing" ]
then then
Log " - missing files:" Log " - missing files:"
cat /tmp/${2}.missing | tee -a $LOGFILE "/tmp/${2}.missing" >> "$LOGFILE"
fi fi
} }
ORIGINAL_COMMAND_LINE="$*" ORIGINAL_COMMAND_LINE="$*"
@ -526,27 +523,27 @@ PLATFORM_SCRIPT_DIR=""
XCOMM XCOMM
XCOMM Set system XCOMM Set system
XCOMM XCOMM
if [ $BUILDSYSTEM = "AIX" ]; if [ "$BUILDSYSTEM" = "AIX" ];
then then
PLATFORM=aix PLATFORM=aix
PLATFORM_SCRIPT_DIR=ibm PLATFORM_SCRIPT_DIR=ibm
elif [ $BUILDSYSTEM = "SunOS" ]; elif [ "$BUILDSYSTEM" = "SunOS" ];
then then
PLATFORM=sun PLATFORM=sun
PLATFORM_SCRIPT_DIR=sun PLATFORM_SCRIPT_DIR=sun
elif [ $BUILDSYSTEM = "Linux" ]; elif [ "$BUILDSYSTEM" = "Linux" ];
then then
PLATFORM="linux" PLATFORM="linux"
PLATFORM_SCRIPT_DIR="linux" PLATFORM_SCRIPT_DIR="linux"
elif [ $BUILDSYSTEM = "FreeBSD" ]; elif [ "$BUILDSYSTEM" = "FreeBSD" ];
then then
PLATFORM="freebsd" PLATFORM="freebsd"
PLATFORM_SCRIPT_DIR="freebsd" PLATFORM_SCRIPT_DIR="freebsd"
elif [ $BUILDSYSTEM = "OpenBSD" ]; elif [ "$BUILDSYSTEM" = "OpenBSD" ];
then then
PLATFORM="openbsd" PLATFORM="openbsd"
PLATFORM_SCRIPT_DIR="openbsd" PLATFORM_SCRIPT_DIR="openbsd"
elif [ $BUILDSYSTEM = "NetBSD" ]; elif [ "$BUILDSYSTEM" = "NetBSD" ];
then then
PLATFORM="netbsd" PLATFORM="netbsd"
PLATFORM_SCRIPT_DIR="netbsd" PLATFORM_SCRIPT_DIR="netbsd"
@ -557,9 +554,9 @@ XCOMM
if [ "$PLATFORM" = "aix" ]; if [ "$PLATFORM" = "aix" ];
then then
USER=`/bin/whoami` USER=$(/bin/whoami)
else else
USER=`/usr/bin/whoami` USER=$(/usr/bin/whoami)
fi fi
if [ "$USER" != "root" ]; if [ "$USER" != "root" ];
@ -590,7 +587,6 @@ XCOMM
RUN_SCRIPTS_ONLY="no" RUN_SCRIPTS_ONLY="no"
DATABASE_FILES="" DATABASE_FILES=""
BUILD_TREE="" BUILD_TREE=""
TAR_DIR=""
LeaveLinks="no" LeaveLinks="no"
REMOVE_LINKS="no" REMOVE_LINKS="no"
CLEAN_DAEMONS="yes" CLEAN_DAEMONS="yes"
@ -782,30 +778,29 @@ XCOMM
echo "" echo ""
if [ -z "$BUILD_TREE" -a -z "$TAR_TREE" ] if [ -z "$BUILD_TREE" ] && [ -z "$TAR_TREE" ]
then then
USAGE USAGE
exit 1 exit 1
fi fi
if [ "$BUILD_TREE" != "" -a ! -d "$BUILD_TREE" ] if [ "$BUILD_TREE" != "" ] && [ ! -d "$BUILD_TREE" ]
then then
Log "Build tree does not exist." Log "Build tree does not exist."
exit 1 exit 1
fi fi
if [ "$TAR_TREE" != "" -a ! -d "$TAR_TREE" ] if [ "$TAR_TREE" != "" ] && [ ! -d "$TAR_TREE" ]
then then
Log "Tar tree does not exist." Log "Tar tree does not exist."
exit 1 exit 1
fi fi
if [ "$DESTINATION_DIR" != "" -a ! -d "$DESTINATION_DIR" ] if [ "$DESTINATION_DIR" != "" ] && [ ! -d "$DESTINATION_DIR" ]
then then
Log "Creating $DESTINATION_DIR" Log "Creating $DESTINATION_DIR"
mkdir $DESTINATION_DIR
if [ $? -ne 0 ] if ! mkdir "$DESTINATION_DIR"
then then
Log "mkdir $DESTINATION_DIR failed" Log "mkdir $DESTINATION_DIR failed"
exit 1 exit 1
@ -823,11 +818,11 @@ XCOMM
if [ $TARBALL = "yes" ]; if [ $TARBALL = "yes" ];
then then
set -- `/bin/date` set -- "$(/bin/date)"
DATE=$2_$3_$4_$6 DATE=$2_$3_$4_$6
fi fi
if [ -z "$BUILD_TREE" -a ${0##STAR/} = INSTALL.CDE ]; then if [ -z "$BUILD_TREE" ] && [ "${0##STAR/}" = INSTALL.CDE ]; then
typeset -u CDEPACKAGE typeset -u CDEPACKAGE
typeset -u CDETARFILE typeset -u CDETARFILE
typeset -u CDETARFILEZ typeset -u CDETARFILEZ
@ -919,7 +914,7 @@ XCOMM
[ -z "$CONFIGURE_LOCATION" ] && CONFIGURE_LOCATION=CDE_CONFIGURATION_TOP [ -z "$CONFIGURE_LOCATION" ] && CONFIGURE_LOCATION=CDE_CONFIGURATION_TOP
[ -z "$LOGFILES_LOCATION" ] && LOGFILES_LOCATION=CDE_LOGFILES_TOP [ -z "$LOGFILES_LOCATION" ] && LOGFILES_LOCATION=CDE_LOGFILES_TOP
if [ -L $INSTALL_LOCATION -a "$CONFIGURE_ONLY" != "yes" ] if [ -L $INSTALL_LOCATION ] && [ "$CONFIGURE_ONLY" != "yes" ]
then then
touch $INSTALL_LOCATION/foo >/dev/null 2>/dev/null touch $INSTALL_LOCATION/foo >/dev/null 2>/dev/null
if [ ! -f $INSTALL_LOCATION/foo ] if [ ! -f $INSTALL_LOCATION/foo ]
@ -937,7 +932,7 @@ XCOMM
if [ -d $INSTALL_LOCATION ] if [ -d $INSTALL_LOCATION ]
then then
if [ -x $INSTALL_LOCATION/bin -a ! -d $INSTALL_LOCATION/bin ] if [ -x $INSTALL_LOCATION/bin ] && [ ! -d $INSTALL_LOCATION/bin ]
then then
rm -f $INSTALL_LOCATION/bin rm -f $INSTALL_LOCATION/bin
fi fi
@ -978,22 +973,22 @@ XCOMM
then then
Log "Load the Desktop from $BUILD_TREE" Log "Load the Desktop from $BUILD_TREE"
cd $STARTING_DIR cd "$STARTING_DIR" || exit 1
let j=1 let j=1
for i in `echo $DATABASE_FILES` for i in $DATABASE_FILES
do do
LoadFileSet "$j" "$i" LoadFileSet "$j" "$i"
let j=j+1 let j=j+1
done done
else else
Log "Load the Desktop from $TAR_TREE" Log "Load the Desktop from $TAR_TREE"
compressed=$(awk '/COMPRESSED: /{print $2}' $TAR_TREE/$CDEPACKAGE) compressed=$(awk '/COMPRESSED: /{print $2}' "$TAR_TREE/$CDEPACKAGE")
if [ "$compressed" = "yes" ]; then if [ "$compressed" = "yes" ]; then
uncompress <$TAR_TREE/$CDETARFILEZ | tar xvf - $INSTALL_LOCATION uncompress <"$TAR_TREE/$CDETARFILEZ" | tar xvf - $INSTALL_LOCATION
else else
tar -xvf $TAR_TREE/$CDETARFILE $INSTALL_LOCATION tar -xvf "$TAR_TREE/$CDETARFILE" $INSTALL_LOCATION
fi fi
DATABASE_FILES=$(awk 'BEGIN {FS=":"} /FILESETS: /{print $2}' $TAR_TREE/$CDEPACKAGE) DATABASE_FILES=$(awk 'BEGIN {FS=":"} /FILESETS: /{print $2}' "$TAR_TREE/$CDEPACKAGE")
fi fi
Log " " Log " "
@ -1009,7 +1004,7 @@ XCOMM
MakeTarball MakeTarball
fi fi
cd $STARTING_DIR cd "$STARTING_DIR" || exit 1
if [ "$RUN_SCRIPTS" = "yes" ] if [ "$RUN_SCRIPTS" = "yes" ]
then then