Forum: CFEngine Help
Subject: Re: filecopy, transform with grep.
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,22985,23023#msg-23023

Thanks, Neil, for your reply.

I believe that your analysis (beginning "The intent of the original grep 
promise...") is subtly but critically flawed (in its attempts to show that my 
"grep" example is somehow different).  I hope to demonstrate that all three 
examples (my "grep", the manual's "postfix" example, and your "gzip/tar" 
example) are still, in fact, equivalent.

Can I demonstrate?  I'll split your paragraph into numbered sections. I've used 
copy-and-paste in an attempt to ensure accurate transcription.

(1) The intent of the original grep promise is to promise the contents of the 
target file.

(2) The grep command cannot really do it.  If the file contain garbage it will 
still be garbage after the grep command.

(3) Cfengine can do better. It can promise the exact contents of the target 
file.

(4) It does this either by copying the desired file from a masterfiles location 
or by editing the file based on changes in the policy.

The flaw of trying to isolate the grep example as somehow different lies in 
your clause (3) when taken in relation to your clause (4).

I hope my analysis below, in lettered sections demonstrates that all three 
examples ("grep", "postfix" and "gzip/tar") remain equivalent, not different, 
to each other.

(a) Referring to your clause (1): the desired intent of all three examples, not 
just my 'grep' example, is to promise (somehow) the contents of the target 
file, i.e. the same across all three examples.

(b) Your clause (3) is a nice wish, which applies to all three examples.  The 
same.

(c) Your clause (2) about "garbage in, garbage out (GIGO)" applies not only to 
the 'grep' example but also equivalently to both the postfix and gzip/tar 
examples.  The same.

(d) All three examples require an implementation, which is what your clause (4) 
is about.  But recall your GIGO concern of clause (2).  You expressed that only 
in relation to the 'grep' example but it applies equally to the gzip/tar and 
postfix examples. All three examples are equivalent, because if the 
"masterfiles location" or "editing the file" or initial tarfile starts with 
garbage then they, too, will produce garbage output. 

My 'grep', your 'gzip/tar', and the manual's 'postfix' examples ALL suffer from 
the potential GIGO issues.  They are no different to each other, are they?  All 
these examples produce their promised output based on some form of input, don't 
they?  All potentially suffer from the GIGO problem, don't they?

So cfengine's behaviour for all cases is equivalent:
 * if the input is garbage the transformed output is garbage;
 * if the input is good, the transformed output can be promised to be as good 
as the transforming process.

Whether that external transforming command is my 'grep', the manual's 
'postalias' or your 'gzip' is irrelevant; they are all, for this purpose, 
equivalent, aren't they?  So, I suggest, my proposed stdout-transformer ('grep' 
being merely one example) is no more flawed than the other example transformers.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to