Compare commits
14 Commits
R3.15.6-rc
...
R3.15.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce7943fb44 | ||
|
|
4e865a03d8 | ||
|
|
9a4febd3bc | ||
|
|
dc5d373b57 | ||
|
|
47c361f135 | ||
|
|
9943796f7f | ||
| 3cb72ec209 | |||
| 701ef5b936 | |||
| c3995a9d63 | |||
| ce3eadde34 | |||
|
|
62929fcbd1 | ||
|
|
456a68eb96 | ||
| 65714033ea | |||
| 7151fbe498 |
@@ -39,11 +39,11 @@ EPICS_PATCH_LEVEL = 0
|
||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre2
|
||||
#EPICS_DEV_SNAPSHOT=-pre2-DEV
|
||||
EPICS_DEV_SNAPSHOT=-rc1
|
||||
#EPICS_DEV_SNAPSHOT=-rc1
|
||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc2
|
||||
#EPICS_DEV_SNAPSHOT=-rc2-DEV
|
||||
#EPICS_DEV_SNAPSHOT=
|
||||
EPICS_DEV_SNAPSHOT=
|
||||
|
||||
# No changes should be needed below here
|
||||
|
||||
|
||||
@@ -9,13 +9,15 @@
|
||||
<body lang="en">
|
||||
<h1 align="center">EPICS Base Release 3.15.6</h1>
|
||||
|
||||
<p style="color:red">This version of EPICS Base has not been released yet.</p>
|
||||
|
||||
|
||||
<h2 align="center">Changes made on the 3.15 branch since 3.15.5</h2>
|
||||
|
||||
<!-- Insert new items immediately below here ... -->
|
||||
|
||||
<h3>Unsetting environment variables</h3>
|
||||
|
||||
<p>The new command <code>epicsEnvUnset <i>varname</i></code> can be used to
|
||||
unset an environment variable.</p>
|
||||
|
||||
<h3>Warning indicators in msi (and macLib) output</h3>
|
||||
|
||||
<p>The libCom macro expansion library has been modified so that when the
|
||||
|
||||
@@ -158,7 +158,7 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
files and directories that are only used for continuous integration:
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6-rc1/ R3.15.6-rc1 --output=base-3.15.6-rc1.tar.gz
|
||||
git archive --prefix=base-3.15.6-rc1/ --output=base-3.15.6-rc1.tar.gz R3.15.6-rc1 configure documentation LICENSE Makefile README src startup
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
@@ -285,7 +285,7 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
generates a gzipped tarfile directly from the repository:
|
||||
<blockquote><tt>
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6/ R3.15.6 --output=base-3.15.6.tar.gz
|
||||
git archive --prefix=base-3.15.6/ --output=base-3.15.6.tar.gz R3.15.6 configure documentation LICENSE Makefile README src startup
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
|
||||
1
src/libCom/env/envDefs.h
vendored
1
src/libCom/env/envDefs.h
vendored
@@ -95,6 +95,7 @@ epicsShareFunc long epicsShareAPI
|
||||
envGetBoolConfigParam(const ENV_PARAM *pParam, int *pBool);
|
||||
epicsShareFunc long epicsShareAPI epicsPrtEnvParams(void);
|
||||
epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *value);
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name);
|
||||
epicsShareFunc void epicsShareAPI epicsEnvShow (const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -110,6 +110,21 @@ static void epicsEnvSetCallFunc(const iocshArgBuf *args)
|
||||
epicsEnvSet (name, value);
|
||||
}
|
||||
|
||||
/* epicsEnvUnset */
|
||||
static const iocshArg epicsEnvUnsetArg0 = { "name",iocshArgString};
|
||||
static const iocshArg * const epicsEnvUnsetArgs[1] = {&epicsEnvUnsetArg0};
|
||||
static const iocshFuncDef epicsEnvUnsetFuncDef = {"epicsEnvUnset",1,epicsEnvUnsetArgs};
|
||||
static void epicsEnvUnsetCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
char *name = args[0].sval;
|
||||
|
||||
if (name == NULL) {
|
||||
fprintf(stderr, "Missing environment variable name argument.\n");
|
||||
return;
|
||||
}
|
||||
epicsEnvUnset (name);
|
||||
}
|
||||
|
||||
/* epicsParamShow */
|
||||
static const iocshFuncDef epicsParamShowFuncDef = {"epicsParamShow",0,NULL};
|
||||
static void epicsParamShowCallFunc(const iocshArgBuf *args)
|
||||
@@ -367,6 +382,7 @@ void epicsShareAPI libComRegister(void)
|
||||
iocshRegister(&pwdFuncDef, pwdCallFunc);
|
||||
|
||||
iocshRegister(&epicsEnvSetFuncDef, epicsEnvSetCallFunc);
|
||||
iocshRegister(&epicsEnvUnsetFuncDef, epicsEnvUnsetCallFunc);
|
||||
iocshRegister(&epicsParamShowFuncDef, epicsParamShowCallFunc);
|
||||
iocshRegister(&epicsPrtEnvParamsFuncDef, epicsPrtEnvParamsCallFunc);
|
||||
iocshRegister(&epicsEnvShowFuncDef, epicsEnvShowCallFunc);
|
||||
|
||||
@@ -91,6 +91,7 @@ epicsShareFunc int epicsShareAPI epicsStdoutPutchar(int c);
|
||||
}
|
||||
|
||||
/* Also pull functions into the std namespace (see lp:1786927) */
|
||||
#if !defined(__GNUC__) || (__GNUC__ > 2)
|
||||
namespace std {
|
||||
using ::epicsGetStdin;
|
||||
using ::epicsGetStdout;
|
||||
@@ -99,6 +100,7 @@ using ::epicsStdoutPrintf;
|
||||
using ::epicsStdoutPuts;
|
||||
using ::epicsStdoutPutchar;
|
||||
}
|
||||
#endif /* __GNUC__ > 2 */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
@@ -39,6 +39,16 @@ epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *val
|
||||
setenv(name, value, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
unsetenv(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
|
||||
89
src/libCom/osi/os/WIN32/osdEnv.c
Normal file
89
src/libCom/osi/os/WIN32/osdEnv.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Saskatchewan
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* osdEnv.c */
|
||||
/*
|
||||
* Author: Eric Norum
|
||||
* Date: May 7, 2001
|
||||
*
|
||||
* Routines to modify/display environment variables and EPICS parameters
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsStdio.h"
|
||||
#include "errlog.h"
|
||||
#include "cantProceed.h"
|
||||
#include "envDefs.h"
|
||||
#include "osiUnistd.h"
|
||||
#include "epicsFindSymbol.h"
|
||||
#include "iocsh.h"
|
||||
|
||||
/*
|
||||
* Set the value of an environment variable
|
||||
* Leaks memory, but the assumption is that this routine won't be
|
||||
* called often enough for the leak to be a problem.
|
||||
*/
|
||||
epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *value)
|
||||
{
|
||||
char *cp;
|
||||
|
||||
iocshEnvClear(name);
|
||||
|
||||
cp = mallocMustSucceed (strlen (name) + strlen (value) + 2, "epicsEnvSet");
|
||||
strcpy (cp, name);
|
||||
strcat (cp, "=");
|
||||
strcat (cp, value);
|
||||
if (putenv (cp) < 0) {
|
||||
errPrintf(
|
||||
-1L,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Failed to set environment parameter \"%s\" to \"%s\": %s\n",
|
||||
name,
|
||||
value,
|
||||
strerror (errno));
|
||||
free (cp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
* Using putenv with a an existing name plus "=" (without value) deletes
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
if (getenv(name) != NULL)
|
||||
epicsEnvSet((char*)name, "");
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
epicsShareFunc void epicsShareAPI epicsEnvShow (const char *name)
|
||||
{
|
||||
if (name == NULL) {
|
||||
extern char **environ;
|
||||
char **sp;
|
||||
|
||||
for (sp = environ ; (sp != NULL) && (*sp != NULL) ; sp++)
|
||||
printf ("%s\n", *sp);
|
||||
}
|
||||
else {
|
||||
const char *cp = getenv (name);
|
||||
if (cp == NULL)
|
||||
printf ("%s is not an environment variable.\n", name);
|
||||
else
|
||||
printf ("%s=%s\n", name, cp);
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,18 @@ epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *val
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
* Using putenv with a an existing name but without "=..." deletes
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
if (getenv(name) != NULL)
|
||||
putenv((char*)name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,16 @@ epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *val
|
||||
setenv(name, value, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
unsetenv(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
|
||||
62
src/libCom/osi/os/solaris/osdEnv.c
Normal file
62
src/libCom/osi/os/solaris/osdEnv.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Saskatchewan
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* osdEnv.c */
|
||||
/*
|
||||
* Author: Eric Norum
|
||||
* Date: May 7, 2001
|
||||
*
|
||||
* Routines to modify/display environment variables and EPICS parameters
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsStdio.h"
|
||||
#include "envDefs.h"
|
||||
#include "osiUnistd.h"
|
||||
#include "iocsh.h"
|
||||
|
||||
/*
|
||||
* Set the value of an environment variable
|
||||
*/
|
||||
epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *value)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
setenv(name, value, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
iocshEnvClear(name);
|
||||
unsetenv(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
epicsShareFunc void epicsShareAPI epicsEnvShow (const char *name)
|
||||
{
|
||||
if (name == NULL) {
|
||||
extern char **environ;
|
||||
char **sp;
|
||||
|
||||
for (sp = environ ; (sp != NULL) && (*sp != NULL) ; sp++)
|
||||
printf ("%s\n", *sp);
|
||||
}
|
||||
else {
|
||||
const char *cp = getenv (name);
|
||||
if (cp == NULL)
|
||||
printf ("%s is not an environment variable.\n", name);
|
||||
else
|
||||
printf ("%s=%s\n", name, cp);
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,25 @@ epicsShareFunc void epicsShareAPI epicsEnvSet (const char *name, const char *val
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Unset an environment variable
|
||||
* Basically destroy the name of that variable because vxWorks does not
|
||||
* support to really unset an environment variable.
|
||||
*/
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsEnvUnset (const char *name)
|
||||
{
|
||||
char* var;
|
||||
|
||||
if (!name) return;
|
||||
iocshEnvClear(name);
|
||||
var = getenv(name);
|
||||
if (!var) return;
|
||||
var -= strlen(name);
|
||||
var --;
|
||||
*var = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the value of the specified, or all, environment variables
|
||||
*/
|
||||
|
||||
@@ -62,6 +62,11 @@ epicsEnvTest_SRCS += epicsEnvTest.c
|
||||
testHarness_SRCS += epicsEnvTest.c
|
||||
TESTS += epicsEnvTest
|
||||
|
||||
TESTPROD_HOST += epicsEnvUnsetTest
|
||||
epicsEnvUnsetTest_SRCS += epicsEnvUnsetTest.c
|
||||
testHarness_SRCS += epicsEnvUnsetTest.c
|
||||
TESTS += epicsEnvUnsetTest
|
||||
|
||||
TESTPROD_HOST += epicsErrlogTest
|
||||
epicsErrlogTest_SRCS += epicsErrlogTest.c
|
||||
testHarness_SRCS += epicsErrlogTest.c
|
||||
|
||||
37
src/libCom/test/epicsEnvUnsetTest.c
Normal file
37
src/libCom/test/epicsEnvUnsetTest.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "macLib.h"
|
||||
#include "envDefs.h"
|
||||
#include "errlog.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "testMain.h"
|
||||
|
||||
static void check(const char* variable, const char* expected)
|
||||
{
|
||||
const char* value;
|
||||
|
||||
value = getenv(variable);
|
||||
if (!testOk((!expected && !value) || (expected && value && strcmp(expected, value) == 0),
|
||||
"%s = \"%s\"", variable, value))
|
||||
{
|
||||
testDiag("should have been \"%s\"", expected);
|
||||
}
|
||||
}
|
||||
|
||||
MAIN(epicsEnvUnsetTest)
|
||||
{
|
||||
eltc(0);
|
||||
testPlan(3);
|
||||
|
||||
check("TEST_VAR_A",NULL);
|
||||
epicsEnvSet("TEST_VAR_A","test value");
|
||||
check("TEST_VAR_A","test value");
|
||||
epicsEnvUnset("TEST_VAR_A");
|
||||
check("TEST_VAR_A",NULL);
|
||||
|
||||
testDone();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user