[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Relative imports.
From: |
Wheeler, John |
Subject: |
RE: Relative imports. |
Date: |
Fri, 5 Sep 2003 14:23:56 -0500 |
You should be able (I haven't tested this so I may be full of it) to just
define CFINPUTS in the control section:
CFINPUTS = ( /my/own/path )
I believe you should also be able to redefine CFINPUTS in subsequent import
files. So your value of CFINPUTS could be dependent on where you are in parsing.
-----Original Message-----
From: Hans Deragon [mailto:hans@deragon.biz]
Sent: Friday, September 05, 2003 8:12 AM
To: help-cfengine@gnu.org
Subject: Relative imports.
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
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine
- RE: Relative imports.,
Wheeler, John <=