Improving <setenv>

Lee Saferite dsaferite at yahoo.co.uk
Thu Mar 21 13:26:15 PST 2002


On Thu, 21 Mar 2002 13:26:16 -0500
"Seth W. Klein" <sk at sethwklein.net> wrote:

> Mark Ellis <mark.uzumati at virgin.net> wrote:
>
> Stages would have to nest and attribute values would have to be
> inherited.

That is what I had in mind and seems to make the most sense.

> Can this replace package then? I think it can. It would add a grouping
> element for packages, too. (I forget what that was called last time
> someone suggested it.)

I would think keeping <package> would be a good thing.  It is a logical element for grouping.  Then you could use <stage> inside it to subdivide it any way you wanted.  That way, you could have an <info> entity with some required info on the package ie. <name>, <version>, <defaultbase>, possibly some sort of depenancy info.  Then the rest would be all stages or just naked elements (correct term?)

<package>
   <info>
      <name>libxml2</name>
      <version>2.4.17</version>
      <maintainer>some guy  someguy at somewhere.com</maintainer>
      <defaultbase>&build-root;/&package-name;-&package-version;</defaultbase>
   </info>
   <stage name="Prebuild" user="lfs" chroot="&LFS>
      (do some stuff here, but I'm too lazy to come up with something)
   </stage>
   <remove>&build-root;/&package-name;-&package-version;</remove>
</package>


As for the env seperator problem, I have very limited xml savoir-faire, but I would ask, can you have nested quotes in an attribute?

An uglier option could be to have some sort of <info> element (maybe a differnet name) inside the stage element.  You could then have a series of elements that set all the needed options.  Actually, I think that sounds bad, and ugly...

<stage>
   <stageinfo>
      <name>Prebuild</name>
      <user>lfs</user>
      <group>lfsgroup</group>
      <chroot>&LFS;</chroot>
      <env mode="append">"you=me" "he=she"</env>
   </stageinfo>

   <make>
      ...
   </make>

   <stage>
      <stageinfo>
         <name>Cleanup</name>
      </stageinfo>
      ...
   </stage>

   <link>
      ...
   </link>

</stage>

Actually, having written the above, I think that looks nicer that my first suggestion.  You could make the stageinfo element a sigle instance only and required.  inside the stageinfo element you would have a required <name> element but the rest could be optional but unique (only one instance).

As always,  Comments/Flames welcome.

Lee
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list