help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting $(allclasses) into a shellcommand


From: Chip Seraphine
Subject: Re: Getting $(allclasses) into a shellcommand
Date: Mon, 19 Jul 2004 14:55:34 -0500
User-agent: KMail/1.5.4

From looking in the code, it would be quite nasty to convert to dynamic 
buffers.

We could do something kludgely like create an editfiles command along the 
lines of 'AppendClasslist', but that is a bit of a last resort.

Here's a rather bad idea-- Would it be possible to do something like have a 
second, third, Nth buffer automatically be set in event that $(allclasses) 
overflows?  Once could then do something hacky like the following:

shellcommands:
        !overflow_1::
                "/some/command $(allclasses)"
        overflow_1.!overflow_2::
                "/some/command $(allclasses):$(allclasses2)"
        overflow_2::
                "/some/command $(allclasses):$(allclasses2):$(allclasses3)"

This could quickly get absurd for very large strings, but that could be 
mitigated by having the $(allclassesN) variables predefined to null values, 
so that you could always just say:
                "/some/command $(allclasses):$(allclasses2):$(allclasses3)"

and it would work in any case.  Well, in any case where $(allclasses4) isn't 
needed.

The above would be quite ugly, but perhaps good enough for a temp fix.

On Monday 19 July 2004 14:20, Mark.Burgess@iu.hio.no wrote:
> 
> I am interested in finding a different solution to this problem.
> Any ideas would be welcome.
> 
> M
> 
> On 19 Jul, Chip Seraphine wrote:
> > On Friday 16 July 2004 13:23, Ted Zlatanov wrote:
> >> On Fri, 16 Jul 2004, tzz@lifelogs.com wrote:
> >> 
> >> >> Anyway, I am having issues passing these large lists of classes into 
the 
> >> >> perl script that does the actual RPM installation.  [snip]
> >> > Why not put it all in a text file with editfiles:, then parse that
> >> > with Perl?
> > 
> > That was my fallback position, but that doesn't work either.  I get the 
same 
> > truncation if I try to do this:
> > 
> > AppendIfNoSuchLine "$(allclasses)"
> > 
> > ...so presumably editfiles and shellcommands use the same size buffer.
> > 
> >> Oh, and of course you don't have to use Perl :)
> > 
> > Blasphemy!  Of *course* it has to be Perl!!!  :-)
> >  
> >> Ted
> > 
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 

-- 

Chip Seraphine
Unix Administrator
TradeLink, LLC
312-264-2048
chip@trdlnk.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]