From 0fd07d1632ba42e537621a337e970267441beb07 Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Fri, 4 Mar 2016 16:08:05 -0600 Subject: [PATCH 1/5] Updated iocsh to allow user to select that lines from included scripts not be echoed. --- src/libCom/iocsh/iocsh.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index d8701532e..6c87aae25 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -587,6 +587,8 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) wasOkToBlock = epicsThreadIsOkToBlock(); epicsThreadSetOkToBlock(1); for (;;) { + bool echo = true; + /* * Read a line */ @@ -608,14 +610,23 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) while ((c = raw[icin]) && isspace(c)) { icin++; } - + + /* + * @ stops the echoing of a line + */ + if (c == '@') { + echo = false; + icin++; + c = raw[icin]; + } + /* * Ignore comment lines other than to echo * them if they came from a script. This * avoids macLib errors from comments. */ if (c == '#') { - if ((prompt == NULL) && (commandLine == NULL)) + if ((prompt == NULL) && (commandLine == NULL) && echo) puts(raw); continue; } @@ -633,11 +644,20 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) while ((c = line[icin]) && isspace(c)) { icin++; } - + + /* + * @ stops the echoing of a line + */ + if (c == '@') { + echo = false; + icin++; + c = raw[icin]; + } + /* * Echo non-empty lines read from a script */ - if ((prompt == NULL) && *line && (commandLine == NULL)) + if ((prompt == NULL) && *line && (commandLine == NULL) && echo) puts(line); /* From e0b578aff5b2121572617d1816c887d81b09fbb5 Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Mon, 7 Mar 2016 14:12:04 -0600 Subject: [PATCH 2/5] Eliminated @-sign echo disabling, replaced with ability to disable comment echoing with '#-' --- src/libCom/iocsh/iocsh.cpp | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index 6c87aae25..c2dde85ed 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -587,7 +587,6 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) wasOkToBlock = epicsThreadIsOkToBlock(); epicsThreadSetOkToBlock(1); for (;;) { - bool echo = true; /* * Read a line @@ -611,23 +610,15 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) icin++; } - /* - * @ stops the echoing of a line - */ - if (c == '@') { - echo = false; - icin++; - c = raw[icin]; - } - /* * Ignore comment lines other than to echo - * them if they came from a script. This - * avoids macLib errors from comments. + * them if they came from a script (disable echoing + * with '#-'). This avoids macLib errors from comments. */ if (c == '#') { - if ((prompt == NULL) && (commandLine == NULL) && echo) - puts(raw); + if ((prompt == NULL) && (commandLine == NULL)) + if (raw[icin + 1] != '-') + puts(raw); continue; } @@ -646,19 +637,12 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) } /* - * @ stops the echoing of a line + * Echo non-empty lines read from a script. + * Comments delineated with '#-' aren't echoed. */ - if (c == '@') { - echo = false; - icin++; - c = raw[icin]; - } - - /* - * Echo non-empty lines read from a script - */ - if ((prompt == NULL) && *line && (commandLine == NULL) && echo) - puts(line); + if ((prompt == NULL) && *line && (commandLine == NULL)) + if ((c != '#') || (line[icin + 1] != '-')) + puts(line); /* * Ignore lines that became a comment or empty after macro expansion From f0b5b52cef758acc4c0873c3fb1fc211aca875af Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Mon, 7 Mar 2016 14:14:33 -0600 Subject: [PATCH 3/5] Whitespace --- src/libCom/iocsh/iocsh.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index c2dde85ed..c5b629ba6 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -587,7 +587,6 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) wasOkToBlock = epicsThreadIsOkToBlock(); epicsThreadSetOkToBlock(1); for (;;) { - /* * Read a line */ @@ -609,7 +608,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) while ((c = raw[icin]) && isspace(c)) { icin++; } - + /* * Ignore comment lines other than to echo * them if they came from a script (disable echoing @@ -635,7 +634,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros) while ((c = line[icin]) && isspace(c)) { icin++; } - + /* * Echo non-empty lines read from a script. * Comments delineated with '#-' aren't echoed. From 92bd217ade5a6ff64462e63892288f2091f85f84 Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Mon, 7 Mar 2016 14:38:59 -0600 Subject: [PATCH 4/5] Updating example iocsh startup scripts --- .../base/top/exampleBoot/ioc/st.cmd@Common | 8 +-- .../base/top/exampleBoot/ioc/st.cmd@RTEMS | 10 ++-- .../base/top/exampleBoot/ioc/st.cmd@vxWorks | 14 ++--- .../base/top/exampleBoot/nfsCommands@RTEMS | 52 ++++++++--------- .../base/top/exampleBoot/nfsCommands@vxWorks | 58 +++++++++---------- .../base/top/iocBoot/ioc/st.cmd@Common | 4 +- .../base/top/iocBoot/ioc/st.cmd@Cross | 4 +- .../base/top/iocBoot/ioc/st.cmd@RTEMS | 6 +- .../base/top/iocBoot/ioc/st.cmd@vxWorks | 6 +- .../base/top/iocBoot/nfsCommands@RTEMS | 58 +++++++++---------- .../base/top/iocBoot/nfsCommands@vxWorks | 58 +++++++++---------- 11 files changed, 139 insertions(+), 139 deletions(-) diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@Common b/src/template/base/top/exampleBoot/ioc/st.cmd@Common index a2d018e3a..b2dfb4ae4 100644 --- a/src/template/base/top/exampleBoot/ioc/st.cmd@Common +++ b/src/template/base/top/exampleBoot/ioc/st.cmd@Common @@ -1,7 +1,7 @@ #!../../bin/_ARCH_/_APPNAME_ -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file < envPaths @@ -16,10 +16,10 @@ dbLoadTemplate "db/user.substitutions" dbLoadRecords "db/_APPNAME_Version.db", "user=_USER_" dbLoadRecords "db/dbSubExample.db", "user=_USER_" -## Set this to see messages from mySub +#- Set this to see messages from mySub #var mySubDebug 1 -## Run this to trace the stages of iocInit +#- Run this to trace the stages of iocInit #traceIocInit cd "${TOP}/iocBoot/${IOC}" diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS b/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS index cc96f84ab..87e9e3b13 100644 --- a/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS +++ b/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS @@ -1,7 +1,7 @@ -## Example RTEMS startup script +#- Example RTEMS startup script -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file #< envPaths @@ -14,10 +14,10 @@ dbLoadTemplate("db/user.substitutions") dbLoadRecords("db/_APPNAME_Version.db", "user=_USER_") dbLoadRecords("db/dbSubExample.db", "user=_USER_") -## Set this to see messages from mySub +#- Set this to see messages from mySub #var mySubDebug 1 -## Run this to trace the stages of iocInit +#- Run this to trace the stages of iocInit #traceIocInit iocInit diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks b/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks index 44a9afc67..617ba6111 100644 --- a/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks +++ b/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks @@ -1,7 +1,7 @@ -## Example vxWorks startup file +#- Example vxWorks startup file -## The following is needed if your board support package doesn't at boot time -## automatically cd to the directory containing its startup script +#- The following is needed if your board support package doesn't at boot time +#- automatically cd to the directory containing its startup script #cd "_TOP_/iocBoot/_IOC_" < cdCommands @@ -9,8 +9,8 @@ cd topbin -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file ld 0,0, "_APPNAME_.munch" ## Register all support components @@ -23,10 +23,10 @@ dbLoadTemplate "db/user.substitutions" dbLoadRecords "db/_APPNAME_Version.db", "user=_USER_" dbLoadRecords "db/dbSubExample.db", "user=_USER_" -## Set this to see messages from mySub +#- Set this to see messages from mySub #mySubDebug = 1 -## Run this to trace the stages of iocInit +#- Run this to trace the stages of iocInit #traceIocInit cd startup diff --git a/src/template/base/top/exampleBoot/nfsCommands@RTEMS b/src/template/base/top/exampleBoot/nfsCommands@RTEMS index 0ba95a6d0..18ae461fa 100644 --- a/src/template/base/top/exampleBoot/nfsCommands@RTEMS +++ b/src/template/base/top/exampleBoot/nfsCommands@RTEMS @@ -1,26 +1,26 @@ -#Instructions for creating and using a real nfsCommands file -# -# in order to use nfs do the following: -# 1) Create hostAdd and nfsMount commands for each nfs server -# 2) In each st.cmd file add the following two commands BEFORE any load commands -# ../nfs.cmd -# cd " -# -# The hostAdd command has the form: -# hostAdd("","xxx.xxx.xxx.xxx") -# -# You can also mount subdirectories as follows: -# nfsMount("", "/xxx/xxx/xxx", "/xxx") -# -# For example assume -# -# host is mercury with inet address 155.77.2.56 -# You want to mount the directory (which is a file system of mercury) -# /home/mercury5/iocinfo -# as -# /iocinfo -# -# The commands would be -# -# hostAdd("mercury","155.77.2.56") -# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") +#- Instructions for creating and using a real nfsCommands file +#- +#- in order to use nfs do the following: +#- 1) Create hostAdd and nfsMount commands for each nfs server +#- 2) In each st.cmd file add the following two commands BEFORE any load commands +#- ../nfs.cmd +#- cd " +#- +#- The hostAdd command has the form: +#- hostAdd("","xxx.xxx.xxx.xxx") +#- +#- You can also mount subdirectories as follows: +#- nfsMount("", "/xxx/xxx/xxx", "/xxx") +#- +#- For example assume +#- +#- host is mercury with inet address 155.77.2.56 +#- You want to mount the directory (which is a file system of mercury) +#- /home/mercury5/iocinfo +#- as +#- /iocinfo +#- +#- The commands would be +#- +#- hostAdd("mercury","155.77.2.56") +#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") diff --git a/src/template/base/top/exampleBoot/nfsCommands@vxWorks b/src/template/base/top/exampleBoot/nfsCommands@vxWorks index 7cb8232f0..eb302c569 100644 --- a/src/template/base/top/exampleBoot/nfsCommands@vxWorks +++ b/src/template/base/top/exampleBoot/nfsCommands@vxWorks @@ -1,29 +1,29 @@ -#Instructions for creating and using a real nfsCommands file -# -# in order to use nfs do the following: -# 1) Create hostAdd and nfsMount commands for each nfs server -# 2) In each st.cmd file add the following two commands BEFORE any load commands -# ../nfs.cmd -# cd " -# -# The hostAdd command has the form: -# hostAdd("","xxx.xxx.xxx.xxx") -# -# The nfsMount command has the form: -# nfsMount("", "/xxx/xxx/xxx", "/xxx") -# -# You can also mount subdirectories as follows: -# nfsMountAll("") -# -# For example assume -# -# host is mercury with inet address 155.77.2.56 -# You want to mount the directory (which is a file system of mercury) -# /home/mercury5/iocinfo -# as -# /iocinfo -# -# The commands would be -# -# hostAdd("mercury","155.77.2.56") -# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") +#- Instructions for creating and using a real nfsCommands file +#- +#- in order to use nfs do the following: +#- 1) Create hostAdd and nfsMount commands for each nfs server +#- 2) In each st.cmd file add the following two commands BEFORE any load commands +#- ../nfs.cmd +#- cd " +#- +#- The hostAdd command has the form: +#- hostAdd("","xxx.xxx.xxx.xxx") +#- +#- The nfsMount command has the form: +#- nfsMount("", "/xxx/xxx/xxx", "/xxx") +#- +#- You can also mount subdirectories as follows: +#- nfsMountAll("") +#- +#- For example assume +#- +#- host is mercury with inet address 155.77.2.56 +#- You want to mount the directory (which is a file system of mercury) +#- /home/mercury5/iocinfo +#- as +#- /iocinfo +#- +#- The commands would be +#- +#- hostAdd("mercury","155.77.2.56") +#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@Common b/src/template/base/top/iocBoot/ioc/st.cmd@Common index ba71fbf81..dd0811dfb 100644 --- a/src/template/base/top/iocBoot/ioc/st.cmd@Common +++ b/src/template/base/top/iocBoot/ioc/st.cmd@Common @@ -1,7 +1,7 @@ #!../../bin/_ARCH_/_APPNAME_ -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file < envPaths diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@Cross b/src/template/base/top/iocBoot/ioc/st.cmd@Cross index 59e94ea2d..f42a26c1b 100644 --- a/src/template/base/top/iocBoot/ioc/st.cmd@Cross +++ b/src/template/base/top/iocBoot/ioc/st.cmd@Cross @@ -1,7 +1,7 @@ #!../../bin/_ARCH_/_APPNAME_ -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file #< envPaths diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS b/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS index f7c3d164f..a7d08fbcf 100644 --- a/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS +++ b/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS @@ -1,7 +1,7 @@ -## Example RTEMS startup script +#- Example RTEMS startup script -## You may have to change _APPNAME_ to something else -## everywhere it appears in this file +#- You may have to change _APPNAME_ to something else +#- everywhere it appears in this file #< envPaths diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks b/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks index 04db4150f..43287d68b 100644 --- a/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks +++ b/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks @@ -1,7 +1,7 @@ -## Example vxWorks startup file +#- Example vxWorks startup file -## The following is needed if your board support package doesn't at boot time -## automatically cd to the directory containing its startup script +#- The following is needed if your board support package doesn't at boot time +#- automatically cd to the directory containing its startup script #cd "_TOP_/iocBoot/_IOC_" < cdCommands diff --git a/src/template/base/top/iocBoot/nfsCommands@RTEMS b/src/template/base/top/iocBoot/nfsCommands@RTEMS index 62221da7c..dd8811319 100644 --- a/src/template/base/top/iocBoot/nfsCommands@RTEMS +++ b/src/template/base/top/iocBoot/nfsCommands@RTEMS @@ -1,29 +1,29 @@ -#Instructions for creating and using a real nfsCommands file -# -# in order to use nfs do the following: -# 1) Create hostAdd and nfsMount commands for each nfs server -# 2) In each st.cmd file add the following two commands BEFORE any load commands -# ../nfs.cmd -# cd " -# -# The hostAdd command has the form: -# hostAdd("","xxx.xxx.xxx.xxx") -# -# The vxWorks nfsMount command has the form: -# nfsMount("") -# -# You can also mount subdirectories as follows: -# nfsMount("", "/xxx/xxx/xxx", "/xxx") -# -# For example assume -# -# host is mercury with inet address 155.77.2.56 -# You want to mount the directory (which is a file system of mercury) -# /home/mercury5/iocinfo -# as -# /iocinfo -# -# The commands would be -# -# hostAdd("mercury","155.77.2.56") -# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") +#- Instructions for creating and using a real nfsCommands file +#- +#- in order to use nfs do the following: +#- 1) Create hostAdd and nfsMount commands for each nfs server +#- 2) In each st.cmd file add the following two commands BEFORE any load commands +#- ../nfs.cmd +#- cd " +#- +#- The hostAdd command has the form: +#- hostAdd("","xxx.xxx.xxx.xxx") +#- +#- The vxWorks nfsMount command has the form: +#- nfsMount("") +#- +#- You can also mount subdirectories as follows: +#- nfsMount("", "/xxx/xxx/xxx", "/xxx") +#- +#- For example assume +#- +#- host is mercury with inet address 155.77.2.56 +#- You want to mount the directory (which is a file system of mercury) +#- /home/mercury5/iocinfo +#- as +#- /iocinfo +#- +#- The commands would be +#- +#- hostAdd("mercury","155.77.2.56") +#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") diff --git a/src/template/base/top/iocBoot/nfsCommands@vxWorks b/src/template/base/top/iocBoot/nfsCommands@vxWorks index 62221da7c..dd8811319 100644 --- a/src/template/base/top/iocBoot/nfsCommands@vxWorks +++ b/src/template/base/top/iocBoot/nfsCommands@vxWorks @@ -1,29 +1,29 @@ -#Instructions for creating and using a real nfsCommands file -# -# in order to use nfs do the following: -# 1) Create hostAdd and nfsMount commands for each nfs server -# 2) In each st.cmd file add the following two commands BEFORE any load commands -# ../nfs.cmd -# cd " -# -# The hostAdd command has the form: -# hostAdd("","xxx.xxx.xxx.xxx") -# -# The vxWorks nfsMount command has the form: -# nfsMount("") -# -# You can also mount subdirectories as follows: -# nfsMount("", "/xxx/xxx/xxx", "/xxx") -# -# For example assume -# -# host is mercury with inet address 155.77.2.56 -# You want to mount the directory (which is a file system of mercury) -# /home/mercury5/iocinfo -# as -# /iocinfo -# -# The commands would be -# -# hostAdd("mercury","155.77.2.56") -# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") +#- Instructions for creating and using a real nfsCommands file +#- +#- in order to use nfs do the following: +#- 1) Create hostAdd and nfsMount commands for each nfs server +#- 2) In each st.cmd file add the following two commands BEFORE any load commands +#- ../nfs.cmd +#- cd " +#- +#- The hostAdd command has the form: +#- hostAdd("","xxx.xxx.xxx.xxx") +#- +#- The vxWorks nfsMount command has the form: +#- nfsMount("") +#- +#- You can also mount subdirectories as follows: +#- nfsMount("", "/xxx/xxx/xxx", "/xxx") +#- +#- For example assume +#- +#- host is mercury with inet address 155.77.2.56 +#- You want to mount the directory (which is a file system of mercury) +#- /home/mercury5/iocinfo +#- as +#- /iocinfo +#- +#- The commands would be +#- +#- hostAdd("mercury","155.77.2.56") +#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo") From 5c93eb60491995602785a685dec487724313e9fd Mon Sep 17 00:00:00 2001 From: Keenan Lang Date: Tue, 15 Mar 2016 16:04:57 -0500 Subject: [PATCH 5/5] Updated Changelog --- documentation/RELEASE_NOTES.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index ea511d5e9..7070412e8 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -31,6 +31,12 @@

Changes in 3.16.0.1 made since 3.15.3

+

Echoless comments

+ +

The way comments are parsed by the iocsh interpreter has changed. The +interpreter can be selectively disabled from echoing comments coming from +a script by starting those lines with '#-' rather than just '#'.

+

Build support for CapFast and dbst removed

The build rules associated with the CapFast-related tools sch2edif