123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- XCOMM! /bin/ksh
- XCOMM #######
- XCOMM Product: CDE
- XCOMM Fileset: CDE-RUN
- XCOMM configure
- XCOMM @(#) $TOG: configRun.src /main/1 1998/03/11 16:18:24 mgreess $
- XCOMM #######
- #define HASH #
- #define STAR *
- retval=0
- CreateAppConfigDirectory()
- {
- HASH
- HASH Create the APPCONFIG directory inside DT_CONFIG_TOP and create
- HASH all of its subdirectories
- HASH
- cd "$DT_CONFIG_TOP" || exit
- if [ ! -d "$APPCONFIG" ]
- then
- mkdir "$APPCONFIG"
- fi
- cd "$APPCONFIG" || exit
- for i in $APPCONFIG_DIRS
- do
- (
- if [ ! -d "$i" ]
- then
- mkdir "$i"
- fi
- cd "$i" || exit
- HASH
- HASH for each locale
- HASH
- for j in $DT_TOP/$APPCONFIG/$i/STAR
- do
- if [ ! -d "$(basename "$j")" ]
- then
- mkdir "$(basename "$j")"
- fi
- done
- )
- done
- }
- doDttermTerminfo()
- {
- if [ -f "$DT_TOP/config/dtterm.ti" ]
- then
- tic "$DT_TOP/config/dtterm.ti"
- if [ -f /usr/share/lib/terminfo/d/dtterm ]
- then
- chown bin /usr/share/lib/terminfo/d/dtterm
- chgrp bin /usr/share/lib/terminfo/d/dtterm
- chmod 644 /usr/share/lib/terminfo/d/dtterm
- else
- if [ -f /usr/share/terminfo/d/dtterm ]
- then
- chown bin /usr/share/terminfo/d/dtterm
- chgrp bin /usr/share/terminfo/d/dtterm
- chmod 644 /usr/share/terminfo/d/dtterm
- fi
- fi
- if [ ! -f /usr/share/lib/terminfo/d/dtterm ] && [ ! -f /usr/share/terminfo/d/dtterm ]
- then
- echo "Unable to compile $DT_TOP/config/dtterm.ti"
- fi
- else
- echo "Unable to find $DT_TOP/config/dtterm.ti"
- fi
- }
- RemoveRunFiles()
- {
- while read -r SRC
- do
- if [ "$SRC" != "" ]
- then
- rm -f "$SRC"
- dirname=${SRC%/STAR}
- if [ -d "$dirname" ]
- then
- cd "$dirname" || exit
- while [ "$dirname" != "$CDE_TOP" ]
- do
- cd ..
- rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null
- dirname=${dirname%/STAR}
- done
- fi
- fi
- done <<-EOF
- #include "CDE-RUN.list"
- EOF
- }
- VerifyInstalledFiles()
- {
- echo "Status mode owner group filename"
- echo "-----------------------------------------"
- XCOMM exists correct correct correct /usr/dt/foo1
- XCOMM MISSING WRONG WRONG WRONG /usr/dt/foo2
- XCOMM exists the link is correct /usr/dt/link
- while read SRC
- do
- #include "../verify.func"
- done <<-EOF
- #include "CDE-RUN.lst"
- EOF
- }
- PrintUsage()
- {
- echo "Usage:" "$0" "[OPERATION]"
- echo ""
- echo "Operations:"
- echo " -e configure"
- echo " -d deconfigure"
- echo " -v verify"
- echo " -s size"
- echo " -h help"
- }
- #include "../option.func"
- XCOMM ##########################################################################
- XCOMM
- XCOMM Main Body
- XCOMM
- XCOMM ##########################################################################
- DT_TOP=CDE_INSTALLATION_TOP
- DT_CONFIG_TOP=CDE_CONFIGURATION_TOP
- DT_TEMP_TOP=CDE_LOGFILES_TOP
- retval=0
- APPCONFIG=appconfig
- APPCONFIG_DIRS="appmanager help icons types"
- HandleOption "$*"
- if [ "$OPERATION" = "usage" ]
- then
- PrintUsage
- exit 0
- fi
- if [ "$OPERATION" = "configure" ]
- then
- HASH
- HASH create the CDE_LOGFILES_TOP directory
- HASH
- if [ ! -d $DT_TEMP_TOP/$APPCONFIG/appmanager ]
- then
- mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager
- fi
- cd "$DT_TEMP_TOP" || exit
- mv $APPCONFIG/appmanager .hidden-appmanager
- chmod -R 755 -- *
- chmod 755 .hidden-appmanager
- chown -R bin -- *
- chgrp -R bin -- *
- mv .hidden-appmanager $APPCONFIG/appmanager
- chmod 755 .
- chown bin .
- chgrp bin .
- HASH
- HASH create the CDE_CONFIGURATION_TOP and its config directory
- HASH
- if [ ! -d $DT_CONFIG_TOP ]
- then
- mkdir -p $DT_CONFIG_TOP
- fi
- if [ ! -d $DT_CONFIG_TOP/config ]
- then
- mkdir -p $DT_CONFIG_TOP/config
- fi
- CreateAppConfigDirectory
- HASH
- HASH ConfigurePrintersDir
- HASH
- HASH env LANG=C /usr/dt/bin/dtprintinfo -populate
- HASH
- HASH Configure Xsession.d
- HASH
- cd $DT_CONFIG_TOP/config || exit
- if [ ! -d Xsession.d ]
- then
- mkdir Xsession.d
- fi
- cd $DT_CONFIG_TOP || exit
- chmod -R 755 -- *
- doDttermTerminfo
- elif [ "$OPERATION" = "deconfigure" ]
- then
- RemoveRunFiles
- VerifyInstalledFiles
- elif [ "$OPERATION" = "verify" ]
- then
- VerifyInstalledFiles
- fi
- return $retval
|