help-cfengine
[Top][All Lists]
Advanced

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

Relative imports.


From: Hans Deragon
Subject: Relative imports.
Date: Fri, 05 Sep 2003 09:12:06 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Greetings.


Newbie here. I have built many little cfengine scripts to modularize fonctionnality. The scripts are stored in subdirectories and import other scripts under other subdirectories. There is however one thing I do not really like and that is that in the import statements, I have to provide the full path after $CFINPUTS.

  This is what I would like to be able to do:

File $CFINPUTS/A.cf:

  import:

     linux:: linux/B.cf

File $CFINPUTS/linux/B.cf:

  import:

     redhat:: redhat/C.cf

File $CFINPUTS/linux/redhat/C.cf:

  import:

    redhat_9::  9/D.cf

You get the picture?  For the moment, I must write file C.cf as:

  import:

     redhat_9::  linux/redhat/9/D.cf

...but I would like to avoid having to prepend the import statement with ¨linux/redhat¨. The main reason is that as I work, I might want to reorganise later the directories. For instance, I might move the scripts from ¨linux/redhat/9¨ to ¨linux/redhat/i386/9¨. But this would require me to edit all the scripts under the ¨9¨ directory.

Is there any way to reassign CFINPUTS locally in a script?


Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.         Open source:
http://www.deragon.biz            http://swtmvcwrapper.sourceforge.net
mailto://hans@deragon.biz         http://autopoweroff.sourceforge.net






reply via email to

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