help-cfengine
[Top][All Lists]
Advanced

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

Re: DefineClasses in editfiles


From: Mark . Burgess
Subject: Re: DefineClasses in editfiles
Date: Mon, 31 May 2004 08:52:58 +0200 (MEST)

I would use "methods". See the example of tar-file package installation
at

http://www.cfengine.org/confdir/methods.html

M

On 31 May, Steve Wray wrote:
> I need to run a shellcommand to unzip a file,
> then an editfiles to edit contents of something in that file,
> then another shellcommand to zip it up again.
> 
> Like this;
> 
> shellcommands:
>    Mozilla_Update::
>       "/usr/bin/unzip US.jar"
>       chdir=/usr/lib/mozilla-firefox/chrome
>       define=Mozilla_Ready_To_Edit
> 
> then
> 
> editfiles:
>    Mozilla_Ready_To_Edit::
>    # Having unzipped the darn thing we can now edit it
>    { 
> /usr/lib/mozilla-firefox/chrome/locale/US/browser-region/region.properties
>       ReplaceAll "^homePageDefault=.*mozilla.*$" With 
> "homePageDefault=http://intranet";
>       ReplaceAll "^browser.startup.homepage=.*mozilla.*$" With
>       "browser.startup.homepage=http://intranet"; ReplaceAll 
> "^browser.throbber.url=.*mozilla.*$"
>       With "browser.throbber.url=http://intranet"; ReplaceAll
>       "^startup.homepage_override_url=.*mozilla.*$" With
>       "startup.homepage_override_url=http://intranet";
>       # and once its edited we are ready to zip it back up:
>       DefineClasses "Mozilla_Ready_To_Zip"
>    }
> 
> then
> 
> shellcommands:
>    Mozilla_Ready_To_Zip::
>       "/usr/bin/zip -rm US.jar locale"
>       chdir=/usr/lib/mozilla-firefox/chrome
> 
> I've tried this with the two shell commands in one shellcommands definition,
> and seperately like I show here.
> 
> The control section looks like this;
> 
>    actionsequence = ( shellcommands editfiles shellcommands  )
> 
> Yet 
> # cfagent -K -v -DMozilla_Update
> does the first shellcommand, does the editfiles and does not do the second 
> shellcommand.
> 
> It looks as if the 
> DefineClasses "Mozilla_Ready_To_Zip"
> does't actually define the class.
> (I've tried with and without the quotes).
> 
> The documentation says;
> 
> DefineClasses "class1:class2:..."
>     Activate the following colon, comma or dot-separated list of classes if 
> and only if the file
>     is edited.
> 
> Any suggestions?
> 
> Thanks!
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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