This patch fixes up some additional regressions introduced in the
various shellcheck patches.


-mrt


>From 547d54af0ae89f20d4febdd896323f73aa2ebd17 Mon Sep 17 00:00:00 2001
From: "Matthew R. Trower" <d...@blackshard.net>
Date: Wed, 31 Oct 2018 07:31:21 -0500
Subject: [PATCH] Fix various regressions introduced by shellcheck de-linting

---
 cde/admin/IntegTools/dbTools/installCDE.src           | 14 +++++++++-----
 cde/admin/IntegTools/post_install/configDemos.src     |  2 +-
 cde/admin/IntegTools/post_install/configFonts.src     |  2 +-
 cde/admin/IntegTools/post_install/configHelp.src      |  2 +-
 cde/admin/IntegTools/post_install/configHelpPrg.src   |  2 +-
 cde/admin/IntegTools/post_install/configHelpRun.src   |  2 +-
 cde/admin/IntegTools/post_install/configIcons.src     |  2 +-
 cde/admin/IntegTools/post_install/configInc.src       |  2 +-
 cde/admin/IntegTools/post_install/configMan.src       |  2 +-
 cde/admin/IntegTools/post_install/configManDev.src    |  2 +-
 cde/admin/IntegTools/post_install/configMsgCat.src    |  2 +-
 cde/admin/IntegTools/post_install/configPrg.src       |  2 +-
 cde/admin/IntegTools/post_install/configShlibs.src    |  2 +-
 cde/admin/IntegTools/post_install/linux/configMin.src |  2 +-
 cde/admin/IntegTools/post_install/linux/configRun.src |  2 +-
 cde/admin/IntegTools/post_install/linux/configTT.src  |  2 +-
 cde/programs/dtprintegrate/dtlp.src                   |  4 ++--
 cde/programs/dtprintegrate/dtprintegrate.src          |  2 ++
 18 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/cde/admin/IntegTools/dbTools/installCDE.src b/cde/admin/IntegTools/dbTools/installCDE.src
index 8ae6b29a..d72f426f 100755
--- a/cde/admin/IntegTools/dbTools/installCDE.src
+++ b/cde/admin/IntegTools/dbTools/installCDE.src
@@ -50,6 +50,8 @@ unset FIGNORE
 
 LOGFILE="installCDE.$$.log"
 
+REVISION="$(echo "$Revision: /main/20 $" | awk '{print $2}')"
+
 Log()
 {
   /bin/echo "$1" | tee -a $LOGFILE
@@ -108,6 +110,7 @@ MakeTarball()
 
     cat >"$TARBALL_LOCATION/$DIRNAME/dt.pkg" <<FIN
 PLATFORM: $PLATFORM
+VERSION: $REVISION
 TS: $DATE
 COMPRESSED: $COMPRESS_TARBALL
 SIZE: $size
@@ -180,9 +183,9 @@ CreatePackingList()
       KORNSHELL "$TOOL_DIR/udbToAny.ksh" -toDB -ReleaseStream "$PLATFORM" "$DATABASE_DIR/${i}.udb" > "/tmp/${i}.db"
       if [ -r "/tmp/${i}.db" ]
       then
-        grep -F install_target "/tmp/${i}.db" | cut -sf 2 -d '\: ' < file | while IFS= read -r line
+        for file in `grep -F install_target /tmp/${i}.db | cut -sf 2 -d \: `
         do
-	  echo "$line" >>"$INSTALL_LOCATION/Packing_list"
+	  echo "$file" >>"$INSTALL_LOCATION/Packing_list"
         done
       fi
     done
@@ -483,8 +486,8 @@ XCOMM don't bother if the fileset doesn't exist
   KORNSHELL "$TOOL_DIR/udbToAny.ksh"  -toLst -ReleaseStream "$PLATFORM" \
             "$DATABASE_DIR/${2}.udb" >  "/tmp/${2}.lst"
   Log "      - installing ... "
-  KORNSHELL "$TOOL_DIR/mkProd" -D "$DESTINATION_DIR" -S "$BUILD_TREE" "/tmp/${2}.lst" \
-            2>"/tmp/${2}.err" 1>"/tmp/${2}.good"
+  KORNSHELL "$TOOL_DIR/mkProd" -D "$DESTINATION_DIR" -S "$BUILD_TREE" \
+            "/tmp/${2}.lst" 2>"/tmp/${2}.err" 1>"/tmp/${2}.good"
   Log "        done."
 
   Log "      - checking for errors ..."
@@ -494,7 +497,7 @@ XCOMM don't bother if the fileset doesn't exist
   if [ -s "/tmp/${2}.missing" ]
   then
     Log "      - missing files:"
-    "/tmp/${2}.missing" >> "$LOGFILE"
+    tee -a "$LOGFILE" < "/tmp/${2}.missing"
   fi
 }
 ORIGINAL_COMMAND_LINE="$*"
@@ -572,6 +575,7 @@ XCOMM
   RUN_SCRIPTS_ONLY="no"
   DATABASE_FILES=""
   BUILD_TREE=""
+  TAR_TREE=""
   LeaveLinks="no"
   REMOVE_LINKS="no"
   CLEAN_DAEMONS="yes"
diff --git a/cde/admin/IntegTools/post_install/configDemos.src b/cde/admin/IntegTools/post_install/configDemos.src
index b0c70064..554f48fa 100755
--- a/cde/admin/IntegTools/post_install/configDemos.src
+++ b/cde/admin/IntegTools/post_install/configDemos.src
@@ -68,7 +68,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 7a8d7ee3..6424247b 100755
--- a/cde/admin/IntegTools/post_install/configFonts.src
+++ b/cde/admin/IntegTools/post_install/configFonts.src
@@ -65,7 +65,7 @@ retval=0
 CDE_TOP=CDE_INSTALLATION_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 5cca6674..75401c48 100755
--- a/cde/admin/IntegTools/post_install/configHelp.src
+++ b/cde/admin/IntegTools/post_install/configHelp.src
@@ -66,7 +66,7 @@ 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 dbf416d5..fcd0121e 100755
--- a/cde/admin/IntegTools/post_install/configHelpPrg.src
+++ b/cde/admin/IntegTools/post_install/configHelpPrg.src
@@ -62,7 +62,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 b53a4b51..10f91c03 100755
--- a/cde/admin/IntegTools/post_install/configHelpRun.src
+++ b/cde/admin/IntegTools/post_install/configHelpRun.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 311b3ec3..0856c7db 100755
--- a/cde/admin/IntegTools/post_install/configIcons.src
+++ b/cde/admin/IntegTools/post_install/configIcons.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 58175c4e..26c4249d 100755
--- a/cde/admin/IntegTools/post_install/configInc.src
+++ b/cde/admin/IntegTools/post_install/configInc.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 ed5bb015..7296bddb 100755
--- a/cde/admin/IntegTools/post_install/configMan.src
+++ b/cde/admin/IntegTools/post_install/configMan.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 0ccfea5a..111c96b5 100755
--- a/cde/admin/IntegTools/post_install/configManDev.src
+++ b/cde/admin/IntegTools/post_install/configManDev.src
@@ -75,7 +75,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 96411103..abfcae71 100755
--- a/cde/admin/IntegTools/post_install/configMsgCat.src
+++ b/cde/admin/IntegTools/post_install/configMsgCat.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 3877e43e..4dc8ce13 100755
--- a/cde/admin/IntegTools/post_install/configPrg.src
+++ b/cde/admin/IntegTools/post_install/configPrg.src
@@ -64,7 +64,7 @@ XCOMM ##########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 db467661..144ec947 100755
--- a/cde/admin/IntegTools/post_install/configShlibs.src
+++ b/cde/admin/IntegTools/post_install/configShlibs.src
@@ -63,7 +63,7 @@ XCOMM #########################################################################
 retval=0
 CDE_TOP=CDE_INSTALLATION_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 d67a9d88..bf1b6e8f 100755
--- a/cde/admin/IntegTools/post_install/linux/configMin.src
+++ b/cde/admin/IntegTools/post_install/linux/configMin.src
@@ -115,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 64d7bf07..b3f45574 100755
--- a/cde/admin/IntegTools/post_install/linux/configRun.src
+++ b/cde/admin/IntegTools/post_install/linux/configRun.src
@@ -147,7 +147,7 @@ retval=0
 APPCONFIG=appconfig
 APPCONFIG_DIRS="appmanager help icons types"
 
-  HandleOption "$*"
+  HandleOption $*
 
   if [ "$OPERATION" = "usage" ]
   then
diff --git a/cde/admin/IntegTools/post_install/linux/configTT.src b/cde/admin/IntegTools/post_install/linux/configTT.src
index 4f1ee2f2..5fb79a5b 100755
--- a/cde/admin/IntegTools/post_install/linux/configTT.src
+++ b/cde/admin/IntegTools/post_install/linux/configTT.src
@@ -61,7 +61,7 @@ XCOMM				Main Body
 XCOMM
 XCOMM ######################################################################
 
-  HandleOption "$*"
+  HandleOption $*
 
   if [ "$OPERATION" = "configure" ]
   then
diff --git a/cde/programs/dtprintegrate/dtlp.src b/cde/programs/dtprintegrate/dtlp.src
index 45895e1f..432a93e7 100755
--- a/cde/programs/dtprintegrate/dtlp.src
+++ b/cde/programs/dtprintegrate/dtlp.src
@@ -1047,12 +1047,12 @@ GetAvailPrinters()
 
     if [ -s "$tmpfile" ]
     then
-    while read -r "$tmpfile"
+    while read -r i
     do
         printer_items=$printer_items$comma$i
         comma=','
         ((num_printers=num_printers+1))
-    done
+    done < "$tmpfile"
     fi
     rm -f "$tmpfile"
 }
diff --git a/cde/programs/dtprintegrate/dtprintegrate.src b/cde/programs/dtprintegrate/dtprintegrate.src
index 7cd75b47..17a28074 100755
--- a/cde/programs/dtprintegrate/dtprintegrate.src
+++ b/cde/programs/dtprintegrate/dtprintegrate.src
@@ -43,8 +43,10 @@ base_icon_name="Fpprnt"
 XCOMM
 XCOMM Return codes
 XCOMM
+SUCCESS=0
 USAGE_ERR=1
 CREATE_ERR=2
+NO_WRITE_ERR=3
 
 XCOMM #################################################################
 XCOMM ##  Initialize()
-- 
2.16.2



d...@blackshard.net (Matthew R. Trower) writes:

> Ah, the actual commit in question was
> ff17b57585af5c3ce9555b42daf848a89e10effd
>
> whereas this thread refers to
> e8e03641214e472288d52a12caa5f1e0bf9f69cd
>
>
> ... so many 'shellcheck' commits.  I'm not sure where the thread that
> Chase introduced the patch in question is.  Hopefully I've given plenty
> of information on the situation anyway.
>
> Sorry to spam the list.
>
>
> -mrt
>
>
>
> d...@blackshard.net (Matthew R. Trower) writes:
>
>> ... my apologies; in the interest of precision, I mispoke here: it
>> doesn't actually *break* installation per-say; it spits out alarming
>> amounts of 'kill' spam while sleeping for 6 seconds.  I did the sane
>> thing at this point and mashed Ctrl-C. =)
>>
>> The rest stands.
>>
>> -mrt
>>
>>
>>
>> d...@blackshard.net (Matthew R. Trower) writes:
>>
>>> I'm sorry to report that with this commit, installCDE.src:CleanDaemons()
>>> is utterly broken.  It doesn't work at all on any platform, and breaks
>>> installation on non AIX/freebsd/openbsd/netbsd/linux platforms (eg:
>>> sun).  On those platforms it tries to kill *all* running processes (!!).
>>> Fortunately, the pipeline has further problems, and bails with an error.
>>>
>>> This code at import was originally very simple.  Somehow over the years
>>> it got long and crazy.  Attached is a patch which returns it to its
>>> simple form, this time with a POSIX pipeline that should run correctly
>>> anywhere (at least any POSIX 2004 platform, BSD, and AIX).
>>>
>>>
>>> -mrt
>>>
>>>
>>>
>>>
>>>
>>> Jon Trulson <j...@radscan.com> writes:
>>>
>>>> Merged to master, thanks!
>>>>
>>>> Sorry for the delay in reviewing these - this week was very busy at $JOB.
>>>>
>>>> -jon
>>>>
>>>> On 08/19/2018 03:02 PM, Chase via cdesktopenv-devel wrote:
>>>>> 1st of four incoming patches
>>>>>
>>>>> Thank you for your time,
>>>>> -Chase
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> cdesktopenv-devel mailing list
>>>>> cdesktopenv-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
>>>>>

-- 
-mrt
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to