"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libpromises/eval_context.c" between
cfengine-3.12.6.tar.gz and cfengine-3.12.7.tar.gz

About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version. Community version. LTS (Long Term Support) release.

eval_context.c  (cfengine-3.12.6):eval_context.c  (cfengine-3.12.7)
skipping to change at line 222 skipping to change at line 222
static static
int PackageManagerSeqCompare(const void *a, const void *b, ARG_UNUSED void *data ) int PackageManagerSeqCompare(const void *a, const void *b, ARG_UNUSED void *data )
{ {
return StringSafeCompare((char*)a, ((PackageModuleBody*)b)->name); return StringSafeCompare((char*)a, ((PackageModuleBody*)b)->name);
} }
void AddPackageModuleToContext(const EvalContext *ctx, PackageModuleBody *pm) void AddPackageModuleToContext(const EvalContext *ctx, PackageModuleBody *pm)
{ {
/* First check if the body is there added from previous pre-evaluation /* First check if the body is there added from previous pre-evaluation
* iteration. If it is there update it as we can have new expanded variables . */ * iteration. If it is there update it as we can have new expanded variables . */
ssize_t pm_seq_index; Seq *const bodies = ctx->package_promise_context->package_modules_bodies;
if ((pm_seq_index = SeqIndexOf(ctx->package_promise_context->package_modules ssize_t index = SeqIndexOf(bodies, pm->name, PackageManagerSeqCompare);
_bodies, if (index != -1)
pm->name, PackageManagerSeqCompare)) != -1)
{ {
SeqRemove(ctx->package_promise_context->package_modules_bodies, pm_seq_i ndex); SeqRemove(bodies, index);
} }
SeqAppend(ctx->package_promise_context->package_modules_bodies, pm); SeqAppend(bodies, pm);
} }
PackageModuleBody *GetPackageModuleFromContext(const EvalContext *ctx, PackageModuleBody *GetPackageModuleFromContext(const EvalContext *ctx,
const char *name) const char *name)
{ {
if (name == NULL) if (name == NULL)
{ {
return NULL; return NULL;
} }
skipping to change at line 544 skipping to change at line 544
} }
if (context_expression_whitespace_rx == NULL) if (context_expression_whitespace_rx == NULL)
{ {
Log(LOG_LEVEL_ERR, "The context expression whitespace regular expression could not be compiled, aborting."); Log(LOG_LEVEL_ERR, "The context expression whitespace regular expression could not be compiled, aborting.");
return false; return false;
} }
if (StringMatchFullWithPrecompiledRegex(context_expression_whitespace_rx, co ntext)) if (StringMatchFullWithPrecompiledRegex(context_expression_whitespace_rx, co ntext))
{ {
Log(LOG_LEVEL_INFO, "class names can't be separated by whitespace withou t an intervening operator in expression '%s'", context); Log(LOG_LEVEL_ERR, "class expressions can't be separated by whitespace w ithout an intervening operator in expression '%s'", context);
return false; return false;
} }
Buffer *condensed = BufferNewFrom(context, strlen(context)); Buffer *condensed = BufferNewFrom(context, strlen(context));
BufferRewrite(condensed, &ClassCharIsWhitespace, true); BufferRewrite(condensed, &ClassCharIsWhitespace, true);
res = ParseExpression(BufferData(condensed), 0, BufferSize(condensed)); res = ParseExpression(BufferData(condensed), 0, BufferSize(condensed));
BufferDestroy(condensed); BufferDestroy(condensed);
if (!res.result) if (!res.result)
{ {
skipping to change at line 940 skipping to change at line 940
} }
free(frame->path); free(frame->path);
free(frame); free(frame);
} }
} }
static static
void FreePackageManager(PackageModuleBody *manager) void FreePackageManager(PackageModuleBody *manager)
{ {
assert(manager != NULL);
free(manager->name); free(manager->name);
free(manager->interpreter);
free(manager->module_path);
RlistDestroy(manager->options); RlistDestroy(manager->options);
free(manager); free(manager);
} }
static static
PackagePromiseContext *PackagePromiseConfigNew() PackagePromiseContext *PackagePromiseConfigNew()
{ {
PackagePromiseContext *package_promise_defaults = PackagePromiseContext *package_promise_defaults =
xmalloc(sizeof(PackagePromiseContext)); xmalloc(sizeof(PackagePromiseContext));
package_promise_defaults->control_package_module = NULL; package_promise_defaults->control_package_module = NULL;
 End of changes. 6 change blocks. 
7 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)