From 3c16c3c0dab8218cbc5b6d7d416489ea3c1d85fc Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 29 Jun 2012 17:02:23 -0400 Subject: [PATCH 01/55] Cherry-picking d2b0e920 from 3.15 (closes lp:1773373) --- src/db/dbEvent.c | 82 ++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index ee1673547..6faf82076 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -90,7 +90,8 @@ struct event_user { epicsMutexId lock; epicsEventId ppendsem; /* Wait while empty */ epicsEventId pflush_sem; /* wait for flush */ - + epicsEventId pexitsem; /* wait for event task to join */ + EXTRALABORFUNC *extralabor_sub;/* off load to event task */ void *extralabor_arg;/* parameter to above */ @@ -293,36 +294,45 @@ dbEventCtx epicsShareAPI db_init_events (void) if (!evUser) { return NULL; } - + + /* Flag will be cleared when event task starts */ + evUser->pendexit = TRUE; + evUser->firstque.evUser = evUser; evUser->firstque.writelock = epicsMutexCreate(); - if (!evUser->firstque.writelock) { - return NULL; - } + if (!evUser->firstque.writelock) + goto fail; evUser->ppendsem = epicsEventCreate(epicsEventEmpty); - if (!evUser->ppendsem) { - epicsMutexDestroy (evUser->firstque.writelock); - return NULL; - } + if (!evUser->ppendsem) + goto fail; evUser->pflush_sem = epicsEventCreate(epicsEventEmpty); - if (!evUser->pflush_sem) { - epicsMutexDestroy (evUser->firstque.writelock); - epicsEventDestroy (evUser->ppendsem); - return NULL; - } + if (!evUser->pflush_sem) + goto fail; evUser->lock = epicsMutexCreate(); - if (!evUser->lock) { - epicsMutexDestroy (evUser->firstque.writelock); - epicsEventDestroy (evUser->pflush_sem); - epicsEventDestroy (evUser->ppendsem); - return NULL; - } + if (!evUser->lock) + goto fail; + evUser->pexitsem = epicsEventCreate(epicsEventEmpty); + if (!evUser->pexitsem) + goto fail; evUser->flowCtrlMode = FALSE; evUser->extraLaborBusy = FALSE; evUser->pSuicideEvent = NULL; return (dbEventCtx) evUser; +fail: + if(evUser->lock) + epicsMutexDestroy (evUser->lock); + if(evUser->firstque.writelock) + epicsMutexDestroy (evUser->firstque.writelock); + if(evUser->ppendsem) + epicsEventDestroy (evUser->ppendsem); + if(evUser->pflush_sem) + epicsEventDestroy (evUser->pflush_sem); + if(evUser->pexitsem) + epicsEventDestroy (evUser->pexitsem); + freeListFree(dbevEventUserFreeList,evUser); + return NULL; } /* @@ -346,10 +356,26 @@ void epicsShareAPI db_close_events (dbEventCtx ctx) * hazardous to the system's health. */ epicsMutexMustLock ( evUser->lock ); - evUser->pendexit = TRUE; + if(!evUser->pendexit) { /* event task running */ + evUser->pendexit = TRUE; + epicsMutexUnlock ( evUser->lock ); + + /* notify the waiting task */ + epicsEventSignal(evUser->ppendsem); + /* wait for task to exit */ + epicsEventMustWait(evUser->pexitsem); + + epicsMutexMustLock ( evUser->lock ); + } + epicsMutexUnlock ( evUser->lock ); - /* notify the waiting task */ - epicsEventSignal(evUser->ppendsem); + + epicsEventDestroy(evUser->pexitsem); + epicsEventDestroy(evUser->ppendsem); + epicsEventDestroy(evUser->pflush_sem); + epicsMutexDestroy(evUser->lock); + + freeListFree(dbevEventUserFreeList, evUser); } /* @@ -977,14 +1003,10 @@ static void event_task (void *pParm) } } - epicsEventDestroy(evUser->ppendsem); - epicsEventDestroy(evUser->pflush_sem); - epicsMutexDestroy(evUser->lock); - - freeListFree(dbevEventUserFreeList, evUser); - taskwdRemove(epicsThreadGetIdSelf()); + epicsEventSignal(evUser->pexitsem); + return; } @@ -1008,7 +1030,6 @@ int epicsShareAPI db_start_events ( return DB_EVENT_OK; } - evUser->pendexit = FALSE; evUser->init_func = init_func; evUser->init_func_arg = init_func_arg; if (!taskname) { @@ -1022,6 +1043,7 @@ int epicsShareAPI db_start_events ( epicsMutexUnlock ( evUser->lock ); return DB_EVENT_ERROR; } + evUser->pendexit = FALSE; epicsMutexUnlock ( evUser->lock ); return DB_EVENT_OK; } From b558bd9b16b9a9a299025eb6019dca9a9f0647a3 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 7 Jun 2018 11:21:04 +0200 Subject: [PATCH 02/55] Cherry-picking e794639e from 3.15 (lp:1730982 lp:1762543) --- src/db/dbEvent.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index 6faf82076..9389644fd 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -135,7 +135,9 @@ static char *EVENT_PEND_NAME = "eventTask"; static struct evSubscrip canceledEvent; -static unsigned short ringSpace ( const struct event_que *pevq ) +static epicsMutexId stopSync; + +static unsigned short ringSpace ( const struct event_que *pevq ) { if ( pevq->evque[pevq->putix] == EVENTQEMPTY ) { if ( pevq->getix > pevq->putix ) { @@ -275,7 +277,11 @@ int epicsShareAPI dbel ( const char *pname, unsigned level ) dbEventCtx epicsShareAPI db_init_events (void) { struct event_user * evUser; - + + if (!stopSync) { + stopSync = epicsMutexMustCreate(); + } + if (!dbevEventUserFreeList) { freeListInitPvt(&dbevEventUserFreeList, sizeof(struct event_user),8); @@ -335,6 +341,8 @@ fail: return NULL; } + + /* intentionally leak stopSync to avoid possible shutdown races */ /* * DB_CLOSE_EVENTS() * @@ -370,11 +378,15 @@ void epicsShareAPI db_close_events (dbEventCtx ctx) epicsMutexUnlock ( evUser->lock ); + epicsMutexMustLock (stopSync); + epicsEventDestroy(evUser->pexitsem); epicsEventDestroy(evUser->ppendsem); epicsEventDestroy(evUser->pflush_sem); epicsMutexDestroy(evUser->lock); + epicsMutexUnlock (stopSync); + freeListFree(dbevEventUserFreeList, evUser); } @@ -1005,8 +1017,15 @@ static void event_task (void *pParm) taskwdRemove(epicsThreadGetIdSelf()); + /* use stopSync to ensure pexitsem is not destroy'd + * until epicsEventSignal() has returned. + */ + epicsMutexMustLock (stopSync); + epicsEventSignal(evUser->pexitsem); + epicsMutexUnlock(stopSync); + return; } From e459e8bdd40c6e8fe75ee02a6b3f4292672f82e4 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 7 Jun 2018 11:32:16 +0200 Subject: [PATCH 03/55] cas: don't spin on zero-length search requests (fix lp:1743321) --- src/cas/generic/casDGClient.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cas/generic/casDGClient.cc b/src/cas/generic/casDGClient.cc index 3bb32c3e2..32a403604 100644 --- a/src/cas/generic/casDGClient.cc +++ b/src/cas/generic/casDGClient.cc @@ -646,6 +646,11 @@ caStatus casDGClient::processDG () if ( status != S_cas_success ) { break; } + + if ( this->in.bytesPresent () > 0 && dgInBytesConsumed == 0 && status == S_cas_success ) { + this->in.removeMsg ( this->in.bytesPresent() ); + } + } return status; } From 8f55a1307d93bc72681053b1ede5270dd9bdbf7e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 22 Jun 2018 14:54:06 -0500 Subject: [PATCH 04/55] startup: Update win*.bat files --- startup/win32.bat | 128 ++++++++++---------------------------------- startup/windows.bat | 73 +++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 101 deletions(-) create mode 100755 startup/windows.bat diff --git a/startup/win32.bat b/startup/win32.bat index af9155dd7..575b06f42 100644 --- a/startup/win32.bat +++ b/startup/win32.bat @@ -1,147 +1,73 @@ @ECHO OFF REM ************************************************************************* -REM Copyright (c) 2002 The University of Chicago, as Operator of Argonne +REM Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne REM National Laboratory. REM Copyright (c) 2002 The Regents of the University of California, as REM Operator of Los Alamos National Laboratory. -REM EPICS BASE Versions 3.13.7 -REM and higher are distributed subject to a Software License Agreement found +REM EPICS BASE is distributed subject to a Software License Agreement found REM in file LICENSE that is included with this distribution. REM ************************************************************************* REM -REM Site-specific EPICS environment settings -REM -REM sites should modify these definitions +REM EPICS build configuration environment settings +REM +REM Installers should modify these definitions as appropriate. +REM This file configures the PATH variable from scratch. REM ====================================================== REM ====== REQUIRED ENVIRONMENT VARIABLES FOLLOW ====== REM ====================================================== REM ====================================================== -REM ---------------- WINDOWS --------------------------- +REM ---------------- WINDOWS ------------------------- REM ====================================================== -REM ----- WIN95 ----- -REM set PATH=C:\WINDOWS;C:\WINDOWS\COMMAND -REM ----- WINNT, WIN2000 ----- -REM set PATH=C:\WINNT;C:\WINNT\SYSTEM32 REM ----- WINXP, Vista, Windows 7 ----- -set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\Wbem +set PATH=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem REM ====================================================== -REM ---------------- make and perl --------------------- +REM --------------- Strawberry Perl ------------------ REM ====================================================== -REM --------------- ActiveState perl ------------------- -set PATH=C:\Perl\bin;%PATH% - -REM --------------- mingw make ------------------------ -REM set PATH=C:\mingw-make\bin;%PATH% -REM set PATH=C:\mingw-make82-3\bin;%PATH% - -REM --------------- gnuwin32 make ---------------------- -set PATH=C:\gnuwin32\bin;%PATH% +set PATH=C:\Strawberry\perl\bin;%PATH% +set PATH=C:\Strawberry\perl\site\bin;%PATH% +set PATH=C:\Strawberry\c\bin;%PATH% REM ====================================================== -REM ---------------- cygwin tools ------------------------ +REM --------------- Visual C++ ----------------------- REM ====================================================== -REM (make & perl if above perl and make are REMs) -REM Dont use cygwin GNU make and Perl! -REM cygwin contains tk/tcl, vim, perl, and many unix tools -REM need grep from here NOT from cvs directory -REM set PATH=%PATH%;.;.. -REM set PATH=%PATH%;c:\cygwin\bin - -REM ====================================================== -REM --------------- Visual c++ ------------------------- -REM ====================================================== - -REM ------ Microsoft Visual Studio 2005 ------ -REM call "C:\Program files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86_amd64 -REM set PATH=%PATH%;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin -REM set INCLUDE=%INCLUDE%;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include -REM REM set LIBPATH=%LIBPATH%;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib -REM set LIB=%LIB%;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib - -REM ------ Microsoft Visual Studio 2008 ------ -REM call "C:\Program files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" -REM call "C:\Program files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 -REM set PATH=C:\Program Files\Microsoft SDKs\Windows\v7.0\bin;%PATH% -REM set INCLUDE=C:\Program Files\Microsoft SDKs\Windows\v7.0\include;%INCLUDE% -REM set LIBPATH=C:\Program Files\Microsoft SDKs\Windows\v7.0\lib;%LIBPATH% -REM set LIB=C:\Program Files\Microsoft SDKs\Windows\v7.0\lib;%LIB% - -REM ----- Visual Studion 2010 ----- -REM -- windows-x64 --- -REM call "C:\Program files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64 REM -- win32-x86 --- -call "C:\Program files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 + +REM ----- Visual Studio 2010 ----- +REM call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 + +REM ----- Visual Studio 2015 ----- +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 REM ====================================================== -REM --------------- EPICS -------------------------------- +REM --------------- EPICS Base ----------------------- REM ====================================================== -REM set EPICS_HOST_ARCH=windows-x64 set EPICS_HOST_ARCH=win32-x86 set PATH=%PATH%;G:\epics\base\bin\%EPICS_HOST_ARCH% -set PATH=%PATH%;G:\epics\extensions\bin\%EPICS_HOST_ARCH% REM ====================================================== -REM ------- OPTIONAL ENVIRONMENT VARIABLES FOLLOW -------- +REM ====== OPTIONAL ENVIRONMENT VARIABLES FOLLOW ===== REM ====================================================== REM ====================================================== -REM ----------------- remote CVS ------------------------- +REM --------------------- Git ------------------------ REM ====================================================== -REM set CVS_RSH=c:/cygwin/bin/ssh.exe -REM set CVSROOT=:ext:jba@aps.anl.gov:/usr/local/epicsmgr/cvsroot -REM set HOME=c:/users/%USERNAME% -REM set HOME=c:/users/jba +set PATH=%PATH%;C:\Program files\Git REM ====================================================== -REM ------------------- Bazaar --------------------------- +REM --------------- EPICS Extensions ----------------- REM ====================================================== -set PATH=%PATH%;C:\Program files\Bazaar +REM set PATH=%PATH%;G:\epics\extensions\bin\%EPICS_HOST_ARCH% REM ====================================================== -REM ----------------- GNU make flags --------------------- +REM --------------- Exceed --------------------------- REM ====================================================== -set MAKEFLAGS=-w - -REM ====================================================== -REM -------------- vim (use cygwin vim ) ----------------- -REM ====================================================== -REM HOME needed by vim to write .viminfo file. -REM VIM needed by vim to find _vimrc file. -REM set VIM=c:\cygwin - -REM ====================================================== -REM --------------- Epics Channel Access ----------------- -REM Modify and uncomment the following lines -REM to override the base/configure/CONFIG_ENV defaults -REM ====================================================== -REM set EPICS_CA_ADDR_LIST=n.n.n.n n.n.n.n -REM set EPICS_CA_AUTO_ADDR_LIST=YES - -REM set EPICS_CA_CONN_TMO=30.0 -REM set EPICS_CA_BEACON_PERIOD=15.0 -REM set EPICS_CA_REPEATER_PORT=5065 -REM set EPICS_CA_SERVER_PORT=5064 -REM set EPICS_TS_MIN_WEST=420 - -REM ====================================================== -REM --------------- JAVA --------------------------------- -REM ====================================================== -REM Needed for java extensions -REM set CLASSPATH=G:\epics\extensions\javalib -REM set PATH=%PATH%;C:\j2sdk1.4.1_01\bin -REM set CLASSPATH=%CLASSPATH%;C:\j2sdk1.4.1_01\lib\tools.jar - -REM ====================================================== -REM --------------- Exceed ------------------------------- REM Needed for X11 extensions -REM ====================================================== -REM set EX_VER=7.10 -REM set EX_VER=12.00 REM set EX_VER=14.00 +REM set EX_VER=15.00 REM set PATH=%PATH%;C:\Exceed%EX_VER%\XDK\ REM set PATH=%PATH%;C:\Program Files\Hummingbird\Connectivity\%EX_VER%\Exceed\ diff --git a/startup/windows.bat b/startup/windows.bat new file mode 100755 index 000000000..1b0d32eb2 --- /dev/null +++ b/startup/windows.bat @@ -0,0 +1,73 @@ +@ECHO OFF +REM ************************************************************************* +REM Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne +REM National Laboratory. +REM Copyright (c) 2002 The Regents of the University of California, as +REM Operator of Los Alamos National Laboratory. +REM EPICS BASE is distributed subject to a Software License Agreement found +REM in file LICENSE that is included with this distribution. +REM ************************************************************************* +REM +REM EPICS build configuration environment settings +REM +REM Installers should modify these definitions as appropriate. +REM This file configures the PATH variable from scratch. + +REM ====================================================== +REM ====== REQUIRED ENVIRONMENT VARIABLES FOLLOW ===== +REM ====================================================== + +REM ====================================================== +REM ---------------- WINDOWS ------------------------- +REM ====================================================== +REM ----- WINXP, Vista, Windows 7 ----- +set PATH=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem + +REM ====================================================== +REM --------------- Strawberry Perl ------------------ +REM ====================================================== + +set PATH=C:\Strawberry\perl\bin;%PATH% +set PATH=C:\Strawberry\perl\site\bin;%PATH% +set PATH=C:\Strawberry\c\bin;%PATH% + +REM ====================================================== +REM --------------- Visual C++ ----------------------- +REM ====================================================== +REM -- windows-x64 --- + +REM ----- Visual Studio 2010 ----- +REM call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64 + +REM ----- Visual Studio 2015 ----- +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 + +REM ====================================================== +REM --------------- EPICS Base ----------------------- +REM ====================================================== +set EPICS_HOST_ARCH=windows-x64 +set PATH=%PATH%;G:\epics\base\bin\%EPICS_HOST_ARCH% + +REM ====================================================== +REM ====== OPTIONAL ENVIRONMENT VARIABLES FOLLOW ===== +REM ====================================================== + +REM ====================================================== +REM --------------------- Git ------------------------ +REM ====================================================== +set PATH=%PATH%;C:\Program files\Git + +REM ====================================================== +REM --------------- EPICS Extensions ----------------- +REM ====================================================== +REM set PATH=%PATH%;G:\epics\extensions\bin\%EPICS_HOST_ARCH% + +REM ====================================================== +REM --------------- Exceed --------------------------- +REM ====================================================== +REM Needed for X11 extensions +REM set EX_VER=14.00 +REM set EX_VER=15.00 +REM set PATH=%PATH%;C:\Exceed%EX_VER%\XDK\ +REM set PATH=%PATH%;C:\Program Files\Hummingbird\Connectivity\%EX_VER%\Exceed\ + From 220e404203e51624fb7e90f8fe5bcde2ba2767c4 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 26 Jun 2018 11:23:15 -0500 Subject: [PATCH 05/55] Move EpicsHostArch.pl into src/tools, install to lib/perl --- configure/CONFIG | 5 ++++- {startup => src/tools}/EpicsHostArch.pl | 0 src/tools/Makefile | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) rename {startup => src/tools}/EpicsHostArch.pl (100%) diff --git a/configure/CONFIG b/configure/CONFIG index 6fe6b9b55..9d8d7e04b 100644 --- a/configure/CONFIG +++ b/configure/CONFIG @@ -21,8 +21,11 @@ endif # Provide a default if the user hasn't set EPICS_HOST_ARCH ifeq ($(origin EPICS_HOST_ARCH), undefined) + # Bootstrapping ... + EHA = $(firstword $(wildcard $(EPICS_BASE)/lib/perl/EpicsHostArch.pl \ + $(TOP)/src/tools/EpicsHostArch.pl)) # NB: We use a simply expanded variable here for performance: - EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl) + export EPICS_HOST_ARCH := $(shell perl $(EHA)) endif # diff --git a/startup/EpicsHostArch.pl b/src/tools/EpicsHostArch.pl similarity index 100% rename from startup/EpicsHostArch.pl rename to src/tools/EpicsHostArch.pl diff --git a/src/tools/Makefile b/src/tools/Makefile index bcf12700d..c54470364 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -16,6 +16,9 @@ PERL_MODULES += EPICS/Path.pm PERL_MODULES += EPICS/Release.pm PERL_MODULES += EPICS/Getopts.pm +# This goes into lib/perl, not bin/ +PERL_MODULES += EpicsHostArch.pl + PERL_SCRIPTS += convertRelease.pl PERL_SCRIPTS += cvsclean.pl PERL_SCRIPTS += dos2unix.pl From b32629c3bf4e718afd42acffd3f5e100d0f17a94 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 26 Jun 2018 11:23:35 -0500 Subject: [PATCH 06/55] Start release notes for tidy-startup branch. --- documentation/RELEASE_NOTES.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index b454da0d6..a1c80695b 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,27 @@ +

Cleanup of startup directory

+ +

The files in the startup directory have not been maintained in recent years +and have grown crufty (technical term). This release includes the following +updates to these files:

+ +
    +
  • The EpicsHostArch.pl script has been moved into src/tools +from where it gets installed into lib/perl. The build system has been +adjusted to look for it in both places if the EPICS_HOST_ARCH +environment variable has not been set at build-time. Sites that may have used +this to set EPICS_HOST_ARCH as part of their standard environment may +need to adjust their scripts when they upgrade to this release.
  • + +
  • The existing win32.bat file has been cleaned up and a new +windows.bat file added for 64-bit targets. The contents of these files +should be seen as examples, don't uncomment or install parts for software that +you don't explicitly know that you need.
  • + +
+

Fixes for Launchpad bugs

The following launchpad bugs have fixes included:

From 8144d2ea01bf95585ad938723ce2b7010755befc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 26 Jun 2018 14:47:59 -0500 Subject: [PATCH 07/55] Add HOWTO: Converting Wiki Record Reference to POD --- documentation/RELEASE_NOTES.html | 9 ++ src/tools/dbdToHtml.pl | 146 +++++++++++++++++++++++++++++-- 2 files changed, 149 insertions(+), 6 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 710798082..59cd4ce18 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -16,7 +16,16 @@ +

HOWTO: Converting Wiki Record Reference to POD

+ +

Some documentation has been added to the dbdToHtml.pl script +explaining how Perl POD (Plain Old Documentation) markup can be added to +.dbd files to generate HTML documentation for the record types. To see +these instructions, run perl bin/<host>/dbdToHtml.pl -H +or perldoc bin/<host>/dbdToHtml.pl.

+

Fix problem with numeric soft events

+

Changing from numeric to named soft events introduced an incompatibility when a numeric event 1-255 is converted from a DOUBLE, e.g. from a calc record. The post_event() API is not marked deprecated any more. diff --git a/src/tools/dbdToHtml.pl b/src/tools/dbdToHtml.pl index fac850a7e..d30779dcf 100644 --- a/src/tools/dbdToHtml.pl +++ b/src/tools/dbdToHtml.pl @@ -41,19 +41,69 @@ BEGIN { } } -my $tool = 'dbdToHtml'; +use Pod::Usage; -our ($opt_D, @opt_I, $opt_o); -getopts('DI@o:') or - die "Usage: $tool [-D] [-I dir] [-o file.html] file.dbd.pod\n"; +=head1 NAME + +dbdToHtml.pl - Convert DBD file with POD to HTML + +=head1 SYNOPSIS + +B [B<-h>] [B<-D>] [B<-I> dir] [B<-o> file] file.dbd.pod + +=head1 DESCRIPTION + +Generates HTML documentation from a B<.dbd.pod> file. + +=head1 OPTIONS + +B understands the following options: + +=over 4 + +=item B<-h> + +Help, display usage information. + +=item B<-H> + +Conversion help, display information about converting reference documentation +from the EPICS Wiki into a B<.dbd.pod> file for use with this tool. + +=item B<-D> + +Instead of creating the output file as described, read the input file(s) and +print a B dependency rule for the output file(s) to stdout. + +=item B<-o> file + +Name of the output file to be created. + +=back + +If no output filename is set, the file created will be named after the input +file, removing any directory components in the path and replacing any +B<.dbd.pod> file extension with B<.html>. + +=cut + +our ($opt_h, $opt_H, $opt_D, @opt_I, $opt_o); + +my $tool = 'dbdToHtml.pl'; + +getopts('hHDI@o:') or + pod2usage(2); +pod2usage(-verbose => 2) if $opt_H; +pod2usage(1) if $opt_h; +pod2usage("$tool: No input file given.\n") if @ARGV != 1; my $dbd = DBD->new(); my $infile = shift @ARGV; $infile =~ m/\.dbd.pod$/ or - die "$tool: Input file '$infile' must have '.dbd.pod' extension\n"; + pod2usage("$tool: Input file '$infile' must have '.dbd.pod' extension.\n"); -&ParseDBD($dbd, &Readfile($infile, 0, \@opt_I)); +ParseDBD($dbd, Readfile($infile, 0, \@opt_I)); if (!$opt_o) { ($opt_o = $infile) =~ s/\.dbd\.pod$/.html/; @@ -243,3 +293,87 @@ sub DBD::Recfield::writable { return $fld->dbf_type eq "DBF_NOACCESS" ? 'No' : 'Yes'; } +=pod + +=head1 Converting Wiki Record Reference to POD + +If you open the src/std/rec/aiRecord.dbd.pod file in your favourite plain text +editor you'll see what input was required to generate the aiRecord.html file. +The text markup language we're using is a standard called POD (Plain Old +Documentation) which is used by Perl developers, but you don't need to know Perl +at all to be able to use it. + +When we add POD markup to a record type, we rename its *Record.dbd file to +.dbd.pod in the src/std/rec directory; no other changes are needed for the build +system to find it by its new name. The POD content is effectively just a new +kind of comment that appears in .dbd.pod files, which the formatter knows how to +convert into HTML. The build also generates a plain *Record.dbd file from this +same input file by stripping out all of the POD markup. + +Documentation for Perl's POD markup standard can be found online at +L or you may be able to type 'perldoc +perlpod' into a Linux command-line to see the same text. We added a few POD +keywords of our own to handle the table generation, and I'll cover those briefly +below. + +POD text can appear almost anywhere in a dbd.pod file. It always starts with a +line "=[keyword] [additional text...]" where [keyword] is "title", "head1" +through "head4" etc.. The POD text ends with a line "=cut". There must be a +blank line above every POD line, and in many cases below it as well. + +The POD keywords we have added are "title", "recordtype", "menu", "fields", +"type", "read" and "write". The last 3 are less common but are used in some of +the other record types such as the waveform and aSub records. + +The most interesting of our new keywords is "fields", which takes a list of +record field names on the same line after the keyword and generates an HTML +Table describing those fields based on the field description found in the DBD +parts. In the ai documentation the first such table covers the DTYP and INP +fields, so the line + + =fields DTYP, INP + +generates all this in the output: + +

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldSummaryTypeDCTDefaultReadWriteCA PP
DTYPDevice TypeDEVICEYes YesYesNo
INPInput SpecificationINLINKYes YesYesNo
+ +Note that the "=fields" line must appear inside the DBD's declaration of the +record type, i.e. after the line + + recordtype(ai) { + +The "type", "read" and "write" POD keywords are used inside an individual record +field declaration and provide information for the "Type", "Read" and "Write" +columns of the field's table output for fields where this information is +normally supplied by the record support code. Usage examples for these keywords +can be found in the aai and aSub record types. + +If you look at the L file you'll see that the POD there starts +by documenting a record-specific menu definition. The "menu" keyword generates a +table that lists all the choices found in the named menu. + +=cut From eae59183cc0d2675496425c4b3017dddef383800 Mon Sep 17 00:00:00 2001 From: "J. Lewis Muir" Date: Tue, 26 Jun 2018 15:41:27 -0500 Subject: [PATCH 08/55] Rename Site.{cshrc,profile} to unix.{csh,sh} --- documentation/README.1st | 4 ++-- documentation/README.darwin.html | 2 +- documentation/README.html | 4 ++-- documentation/RELEASE_NOTES.html | 3 +++ startup/{Site.cshrc => unix.csh} | 0 startup/{Site.profile => unix.sh} | 0 6 files changed, 8 insertions(+), 5 deletions(-) rename startup/{Site.cshrc => unix.csh} (100%) rename startup/{Site.profile => unix.sh} (100%) diff --git a/documentation/README.1st b/documentation/README.1st index 462ac460a..4ddad2772 100644 --- a/documentation/README.1st +++ b/documentation/README.1st @@ -223,10 +223,10 @@ EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable - Site.profile bourne shell script to set path and env variables - Site.cshrc c shell script to set path and env variables borland.bat WIN32 bat file to set borland path and env variables cygwin.bat WIN32 bat file to set cygwin path and env variables + unix.csh C shell script to set path and env variables + unix.sh Bourne shell script to set path and env variables win32.bat WIN32 bat file to set path and env variables win32-debug.bat WIN32 debug bat file to set debug path and env variables diff --git a/documentation/README.darwin.html b/documentation/README.darwin.html index cbc290178..dd11ce857 100644 --- a/documentation/README.darwin.html +++ b/documentation/README.darwin.html @@ -21,7 +21,7 @@ of my Bash login script (~/.bash_login): # EPICS_BASE="${HOME}/src/EPICS/base" EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions" -. "${EPICS_BASE}"/startup/Site.profile +. "${EPICS_BASE}"/startup/unix.sh
  • diff --git a/documentation/README.html b/documentation/README.html index a8a572372..ad67cdfcb 100644 --- a/documentation/README.html +++ b/documentation/README.html @@ -232,10 +232,10 @@
             EpicsHostArch       C shell script to set EPICS_HOST_ARCH env variable
             EpicsHostArch.pl    Perl script to set EPICS_HOST_ARCH env variable
    -        Site.profile        bourne shell script to set path and env variables
    -        Site.cshrc          c shell script to set path and env variables
             borland.bat         WIN32 bat file to set borland path and env variables
             cygwin.bat          WIN32 bat file to set cygwin path and env variables
    +        unix.csh            C shell script to set path and env variables
    +        unix.sh             Bourne shell script to set path and env variables
             win32.bat           WIN32 bat file to set path and env variables
             win32-debug.bat     WIN32 debug bat file to set debug path and env variables
     
    diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index a1c80695b..85dc54a7b 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -27,6 +27,9 @@ environment variable has not been set at build-time. Sites that may have used this to set EPICS_HOST_ARCH as part of their standard environment may need to adjust their scripts when they upgrade to this release.
  • +
  • The Site.cshrc and Site.profile files have been renamed to +unix.csh and unix.sh, respectively.
  • +
  • The existing win32.bat file has been cleaned up and a new windows.bat file added for 64-bit targets. The contents of these files should be seen as examples, don't uncomment or install parts for software that diff --git a/startup/Site.cshrc b/startup/unix.csh similarity index 100% rename from startup/Site.cshrc rename to startup/unix.csh diff --git a/startup/Site.profile b/startup/unix.sh similarity index 100% rename from startup/Site.profile rename to startup/unix.sh From 7a5ff269846aa8c09ab972294f193299e21c1537 Mon Sep 17 00:00:00 2001 From: "J. Lewis Muir" Date: Tue, 26 Jun 2018 16:20:07 -0500 Subject: [PATCH 09/55] Remove EpicsHostArch --- ci/travis-build.sh | 2 +- documentation/README.1st | 1 - documentation/README.html | 1 - documentation/RELEASE_NOTES.html | 3 ++ startup/EpicsHostArch | 84 -------------------------------- 5 files changed, 4 insertions(+), 87 deletions(-) delete mode 100755 startup/EpicsHostArch diff --git a/ci/travis-build.sh b/ci/travis-build.sh index a3ca3fd16..2ee5d652f 100644 --- a/ci/travis-build.sh +++ b/ci/travis-build.sh @@ -17,7 +17,7 @@ ticker() { CACHEKEY=1 -EPICS_HOST_ARCH=`sh startup/EpicsHostArch` +EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl` [ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD" diff --git a/documentation/README.1st b/documentation/README.1st index 4ddad2772..f5f209dd1 100644 --- a/documentation/README.1st +++ b/documentation/README.1st @@ -221,7 +221,6 @@ base/startup directory - contains scripts to set environment and path - EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable borland.bat WIN32 bat file to set borland path and env variables cygwin.bat WIN32 bat file to set cygwin path and env variables diff --git a/documentation/README.html b/documentation/README.html index ad67cdfcb..c803ab767 100644 --- a/documentation/README.html +++ b/documentation/README.html @@ -230,7 +230,6 @@

    base/startup directory - contains scripts to set environment and path

    -        EpicsHostArch       C shell script to set EPICS_HOST_ARCH env variable
             EpicsHostArch.pl    Perl script to set EPICS_HOST_ARCH env variable
             borland.bat         WIN32 bat file to set borland path and env variables
             cygwin.bat          WIN32 bat file to set cygwin path and env variables
    diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
    index 85dc54a7b..a419bcabc 100644
    --- a/documentation/RELEASE_NOTES.html
    +++ b/documentation/RELEASE_NOTES.html
    @@ -20,6 +20,9 @@ and have grown crufty (technical term). This release includes the following
     updates to these files: