From e8e03641214e472288d52a12caa5f1e0bf9f69cd Mon Sep 17 00:00:00 2001 From: chase Date: Sat, 18 Aug 2018 13:33:35 -0500 Subject: [PATCH] post_install: fix shellcheck warnings --- .../IntegTools/post_install/build_udb_list | 2 +- .../IntegTools/post_install/configDemos.src | 21 +++--- .../IntegTools/post_install/configFonts.src | 23 +++---- .../IntegTools/post_install/configHelp.src | 23 +++---- .../IntegTools/post_install/configHelpPrg.src | 23 +++---- .../IntegTools/post_install/configHelpRun.src | 23 +++---- .../IntegTools/post_install/configIcons.src | 23 +++---- .../IntegTools/post_install/configInc.src | 23 +++---- .../IntegTools/post_install/configMan.src | 23 +++---- .../IntegTools/post_install/configManDev.src | 29 ++++----- .../IntegTools/post_install/configMsgCat.src | 23 +++---- .../IntegTools/post_install/configPrg.src | 23 +++---- .../IntegTools/post_install/configShlibs.src | 23 +++---- .../post_install/linux/configMin.src | 17 ++--- .../post_install/linux/configRun.src | 64 ++++++++----------- .../post_install/linux/configShlibs.src | 27 ++++---- .../post_install/linux/configTT.src | 17 ++--- cde/admin/IntegTools/post_install/size.func | 14 ---- cde/admin/IntegTools/post_install/verify.func | 18 +++--- 19 files changed, 186 insertions(+), 253 deletions(-) delete mode 100644 cde/admin/IntegTools/post_install/size.func diff --git a/cde/admin/IntegTools/post_install/build_udb_list b/cde/admin/IntegTools/post_install/build_udb_list index 35d6b83d..6af5c716 100755 --- a/cde/admin/IntegTools/post_install/build_udb_list +++ b/cde/admin/IntegTools/post_install/build_udb_list @@ -1,4 +1,4 @@ #!/bin/ksh awk '{if ($1 == "install_target" && $3 != "") print $3}' \ - $2/databases/$1.udb >$1.list + "$2/databases/$1.udb" >"$1.list" diff --git a/cde/admin/IntegTools/post_install/configDemos.src b/cde/admin/IntegTools/post_install/configDemos.src index 7c183bf9..b0c70064 100755 --- a/cde/admin/IntegTools/post_install/configDemos.src +++ b/cde/admin/IntegTools/post_install/configDemos.src @@ -19,19 +19,19 @@ XCOMM # XCOMM ############################################ RemoveDemoFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -45,8 +45,8 @@ 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 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 @@ -61,17 +61,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-DEMOS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configFonts.src b/cde/admin/IntegTools/post_install/configFonts.src index 0419454b..7a8d7ee3 100755 --- a/cde/admin/IntegTools/post_install/configFonts.src +++ b/cde/admin/IntegTools/post_install/configFonts.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveFontFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,18 +57,15 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-FONTS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configHelp.src b/cde/admin/IntegTools/post_install/configHelp.src index fb417a3a..5cca6674 100755 --- a/cde/admin/IntegTools/post_install/configHelp.src +++ b/cde/admin/IntegTools/post_install/configHelp.src @@ -13,19 +13,19 @@ XCOMM ####### RemoveHelpFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -39,11 +39,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -55,21 +55,18 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-HELP-C retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP XCOMM XCOMM set up symlinks that point into the $CDE_TOP tree XCOMM - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configHelpPrg.src b/cde/admin/IntegTools/post_install/configHelpPrg.src index bdfb3ca7..dbf416d5 100755 --- a/cde/admin/IntegTools/post_install/configHelpPrg.src +++ b/cde/admin/IntegTools/post_install/configHelpPrg.src @@ -13,19 +13,19 @@ XCOMM ####### RemoveHelpFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -39,11 +39,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF1 @@ -55,17 +55,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-HELP retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configHelpRun.src b/cde/admin/IntegTools/post_install/configHelpRun.src index efc1de31..b53a4b51 100755 --- a/cde/admin/IntegTools/post_install/configHelpRun.src +++ b/cde/admin/IntegTools/post_install/configHelpRun.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveHelpRunFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-HELP-RUN retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configIcons.src b/cde/admin/IntegTools/post_install/configIcons.src index b3015909..311b3ec3 100755 --- a/cde/admin/IntegTools/post_install/configIcons.src +++ b/cde/admin/IntegTools/post_install/configIcons.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveIconFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-ICONS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configInc.src b/cde/admin/IntegTools/post_install/configInc.src index 5fcc6375..58175c4e 100755 --- a/cde/admin/IntegTools/post_install/configInc.src +++ b/cde/admin/IntegTools/post_install/configInc.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveIncludeFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-INC retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configMan.src b/cde/admin/IntegTools/post_install/configMan.src index dd7be23b..ed5bb015 100755 --- a/cde/admin/IntegTools/post_install/configMan.src +++ b/cde/admin/IntegTools/post_install/configMan.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveManFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-DEMOS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configManDev.src b/cde/admin/IntegTools/post_install/configManDev.src index 985ba1d8..0ccfea5a 100755 --- a/cde/admin/IntegTools/post_install/configManDev.src +++ b/cde/admin/IntegTools/post_install/configManDev.src @@ -15,30 +15,30 @@ XCOMM ############################################ RemoveManDevFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - if [ -L $SRC -a -d $SRC ] + if [ -L "$SRC" ] && [ -d "$SRC" ] then - results=`ls $SRC` + results=$(find -name "$SRC") if [ ! -s "$SRC" ] then - rm -f $SRC + rm -f "$SRC" else continue fi else - rm -f $SRC + rm -f "$SRC" fi dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -52,11 +52,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -68,17 +68,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-MAN-DEV retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configMsgCat.src b/cde/admin/IntegTools/post_install/configMsgCat.src index e760148d..96411103 100755 --- a/cde/admin/IntegTools/post_install/configMsgCat.src +++ b/cde/admin/IntegTools/post_install/configMsgCat.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemoveMsgCatFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-MSG-C retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configPrg.src b/cde/admin/IntegTools/post_install/configPrg.src index 0cfb146c..3877e43e 100755 --- a/cde/admin/IntegTools/post_install/configPrg.src +++ b/cde/admin/IntegTools/post_install/configPrg.src @@ -15,19 +15,19 @@ XCOMM ############################################ RemovePrgFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -41,11 +41,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -57,17 +57,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ########################################################################## XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-PRG retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/configShlibs.src b/cde/admin/IntegTools/post_install/configShlibs.src index a0314384..db467661 100755 --- a/cde/admin/IntegTools/post_install/configShlibs.src +++ b/cde/admin/IntegTools/post_install/configShlibs.src @@ -14,19 +14,19 @@ XCOMM ####### XCOMM ############################################ RemoveShlibFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -40,11 +40,11 @@ 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 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 + while read -r SRC do #include "verify.func" done <<-EOF @@ -56,17 +56,14 @@ XCOMM exists the link is correct /usr/dt/link XCOMM ######################################################################### XCOMM -XCOMM Main Body +XCOMM Main Body XCOMM XCOMM ######################################################################### -PRODUCT=CDE -FILESET=CDE-SHLIBS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/linux/configMin.src b/cde/admin/IntegTools/post_install/linux/configMin.src index cda5678b..d67a9d88 100755 --- a/cde/admin/IntegTools/post_install/linux/configMin.src +++ b/cde/admin/IntegTools/post_install/linux/configMin.src @@ -7,9 +7,6 @@ XCOMM @(#) $TOG: configMin.src /main/1 1998/03/11 16:18:12 mgreess $ XCOMM ####### #define HASH # -PRODUCT=CDE -FILESET=CDE-MIN -DO_CONFIGURATION="" retval=0 FixEtcServices() @@ -72,19 +69,19 @@ TMPFILE=/tmp/services RemoveMinFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -102,7 +99,7 @@ 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 + while read -r SRC do #include "../verify.func" done <<-EOF @@ -118,7 +115,7 @@ XCOMM Main Body XCOMM XCOMM ############################################################### - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "configure" ] then diff --git a/cde/admin/IntegTools/post_install/linux/configRun.src b/cde/admin/IntegTools/post_install/linux/configRun.src index 02b64e8c..64d7bf07 100755 --- a/cde/admin/IntegTools/post_install/linux/configRun.src +++ b/cde/admin/IntegTools/post_install/linux/configRun.src @@ -9,9 +9,6 @@ XCOMM ####### #define HASH # #define STAR * -PRODUCT=CDE -FILESET=CDE-RUN -DO_CONFIGURATION="" retval=0 CreateAppConfigDirectory() @@ -21,41 +18,42 @@ CreateAppConfigDirectory() HASH all of its subdirectories HASH - cd $DT_CONFIG_TOP - if [ ! -d $APPCONFIG ] + cd "$DT_CONFIG_TOP" || exit + if [ ! -d "$APPCONFIG" ] then - mkdir $APPCONFIG + mkdir "$APPCONFIG" fi - cd $APPCONFIG + cd "$APPCONFIG" || exit for i in $APPCONFIG_DIRS do - if [ ! -d $i ] + ( + if [ ! -d "$i" ] then - mkdir $i + mkdir "$i" fi - cd $i + cd "$i" || exit HASH HASH for each locale HASH for j in $DT_TOP/$APPCONFIG/$i/STAR do - if [ ! -d `basename $j` ] + if [ ! -d "$(basename "$j")" ] then - mkdir `basename $j` + mkdir "$(basename "$j")" fi done - cd .. + ) done } doDttermTerminfo() { - if [ -f $DT_TOP/config/dtterm.ti ] + if [ -f "$DT_TOP/config/dtterm.ti" ] then - tic $DT_TOP/config/dtterm.ti + tic "$DT_TOP/config/dtterm.ti" if [ -f /usr/share/lib/terminfo/d/dtterm ] then chown bin /usr/share/lib/terminfo/d/dtterm @@ -69,7 +67,7 @@ doDttermTerminfo() chmod 644 /usr/share/terminfo/d/dtterm fi fi - if [ ! -f /usr/share/lib/terminfo/d/dtterm -a ! -f /usr/share/terminfo/d/dtterm ] + 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 @@ -80,19 +78,19 @@ doDttermTerminfo() RemoveRunFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -122,7 +120,7 @@ XCOMM exists the link is correct /usr/dt/link PrintUsage() { - echo "Usage:" $0 "[OPERATION]" + echo "Usage:" "$0" "[OPERATION]" echo "" echo "Operations:" echo " -e configure" @@ -140,22 +138,16 @@ XCOMM Main Body XCOMM XCOMM ########################################################################## -PRODUCT=CDE -FILESET=CDE-RUN - DT_TOP=CDE_INSTALLATION_TOP DT_CONFIG_TOP=CDE_CONFIGURATION_TOP DT_TEMP_TOP=CDE_LOGFILES_TOP -ROOT=/ retval=0 APPCONFIG=appconfig APPCONFIG_DIRS="appmanager help icons types" -PRINTERS="" -DEFAULT_PRINTER="DtPrint" - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "usage" ] then @@ -175,12 +167,12 @@ DEFAULT_PRINTER="DtPrint" mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager fi - cd $DT_TEMP_TOP + cd "$DT_TEMP_TOP" || exit mv $APPCONFIG/appmanager .hidden-appmanager - chmod -R 755 * + chmod -R 755 -- * chmod 755 .hidden-appmanager - chown -R bin * - chgrp -R bin * + chown -R bin -- * + chgrp -R bin -- * mv .hidden-appmanager $APPCONFIG/appmanager chmod 755 . chown bin . @@ -209,14 +201,14 @@ DEFAULT_PRINTER="DtPrint" HASH Configure Xsession.d HASH - cd $DT_CONFIG_TOP/config + cd $DT_CONFIG_TOP/config || exit if [ ! -d Xsession.d ] then mkdir Xsession.d fi - cd $DT_CONFIG_TOP - chmod -R 755 * + cd $DT_CONFIG_TOP || exit + chmod -R 755 -- * doDttermTerminfo diff --git a/cde/admin/IntegTools/post_install/linux/configShlibs.src b/cde/admin/IntegTools/post_install/linux/configShlibs.src index cf7ab587..c61b60ff 100755 --- a/cde/admin/IntegTools/post_install/linux/configShlibs.src +++ b/cde/admin/IntegTools/post_install/linux/configShlibs.src @@ -6,19 +6,19 @@ XCOMM $TOG: configShlibs.src /main/1 1998/03/11 16:18:33 mgreess $ XCOMM ############################################ RemoveShlibFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -36,7 +36,7 @@ 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 + while read -r SRC do #include "../verify.func" done <<-EOF @@ -54,14 +54,14 @@ XCOMM XCOMM creates links in the install tree libtt.so -> libtt.so.1 XCOMM - cd CDE_INSTALLATION_TOP/lib + cd CDE_INSTALLATION_TOP/lib || exit - for lib in `/bin/ls *.so.*` + for lib in $(/bin/ls) ./*.so.* do - link=`echo $lib | cut -d. -f1,2` + link=$(echo "$lib" | cut -d. -f1,2) - rm -f $link - ln -s $lib $link + rm -f "$link" + ln -s "$lib" "$link" done @@ -73,13 +73,10 @@ XCOMM Main Body XCOMM XCOMM ######################################################################### -PRODUCT=CDE -FILESET=CDE-SHLIBS retval=0 CDE_TOP=CDE_INSTALLATION_TOP -CDE_CONF_TOP=CDE_CONFIGURATION_TOP - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "deconfigure" ] then diff --git a/cde/admin/IntegTools/post_install/linux/configTT.src b/cde/admin/IntegTools/post_install/linux/configTT.src index a1a9f64f..4f1ee2f2 100755 --- a/cde/admin/IntegTools/post_install/linux/configTT.src +++ b/cde/admin/IntegTools/post_install/linux/configTT.src @@ -11,26 +11,23 @@ XCOMM XCOMM ####### #define HASH # -PRODUCT=CDE -FILESET=CDE-TT -DO_CONFIGURATION="" retval=0 RemoveTTFiles() { - while read SRC + while read -r SRC do if [ "$SRC" != "" ] then - rm -f $SRC + rm -f "$SRC" dirname=${SRC%/STAR} - if [ -d $dirname ] + if [ -d "$dirname" ] then - cd $dirname + cd "$dirname" || exit while [ "$dirname" != "$CDE_TOP" ] do cd .. - rmdir ${dirname##STAR/} >/dev/null 2>/dev/null + rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null dirname=${dirname%/STAR} done fi @@ -48,7 +45,7 @@ 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 + while read -r SRC do #include "../verify.func" done <<-EOF @@ -64,7 +61,7 @@ XCOMM Main Body XCOMM XCOMM ###################################################################### - HandleOption $* + HandleOption "$*" if [ "$OPERATION" = "configure" ] then diff --git a/cde/admin/IntegTools/post_install/size.func b/cde/admin/IntegTools/post_install/size.func deleted file mode 100644 index 608a6e8d..00000000 --- a/cde/admin/IntegTools/post_install/size.func +++ /dev/null @@ -1,14 +0,0 @@ - if [ "$SRC" != "" ] - then - set -A tokens $SRC - if [ "${tokens[3]}" = "file" ] - then - if [ -f ${tokens[0]} ] - then - filesize=`ls -l ${tokens[0]} | awk '{print $5}'` - echo "$filesize\t\t\c" - echo "${tokens[0]}" - let total=total+filesize - fi - fi - fi diff --git a/cde/admin/IntegTools/post_install/verify.func b/cde/admin/IntegTools/post_install/verify.func index 886d472e..ad25ff44 100644 --- a/cde/admin/IntegTools/post_install/verify.func +++ b/cde/admin/IntegTools/post_install/verify.func @@ -1,9 +1,9 @@ if [ "$SRC" != "" ] then - set -A tokens $SRC + set -A tokens "$SRC" if [ "${tokens[3]}" = "file" ] then - if [ -f ${tokens[0]} ] + if [ -f "${tokens[0]}" ] then printf "exists " else @@ -13,7 +13,7 @@ fi elif [ "${tokens[3]}" = "sym_link" ] then - if [ -L ${tokens[0]} ] + if [ -L "${tokens[0]}" ] then printf "exists " else @@ -26,9 +26,9 @@ if [ "${tokens[3]}" = "file" ] then touch /tmp/config-test - chmod ${tokens[1]} /tmp/config-test - tmpperms=`ls -l /tmp/config-test | awk '{print $1}'` - realperms=`ls -l ${tokens[0]} | awk '{print $1}'` + chmod "${tokens[1]}" /tmp/config-test + tmpperms=$(ls -l /tmp/config-test | awk '{print $1}') + realperms=$(ls -l "${tokens[0]}" | awk '{print $1}') if [ "$tmpperms" = "$realperms" ] then @@ -37,7 +37,7 @@ printf " WRONG " fi - owner=`ls -l ${tokens[0]} | awk '{print $3}'` + owner=$(ls -l "${tokens[0]}" | awk '{print $3}') if [ "$owner" = "${tokens[4]}" ] then @@ -46,7 +46,7 @@ printf " WRONG " fi - group=`ls -l ${tokens[0]} | awk '{print $4}'` + group=$(ls -l "${tokens[0]}" | awk '{print $4}') if [ "$group" = "${tokens[5]}" ] then @@ -56,7 +56,7 @@ fi elif [ "${tokens[3]}" = "sym_link" ] then - linkto=`ls -l ${tokens[0]} | awk '{print $11}'` + linkto=$(ls -l "${tokens[0]}" | awk '{print $11}') if [ "${tokens[2]}" = "$linkto" ] then printf " the link is correct " -- 2.25.1