Programming alfs parser

Mark Ellis mark.uzumati at virgin.net
Sun Jan 13 13:56:30 PST 2002


On 2002.01.12 14:38 Paul Campbell wrote:
> ... in Java.
> 
> Just for an acedemic exercise.  So far i have the profiles loaded into
> DOM
> trees, and I'm looking for advice on what comes next.
> 
> Java is a bit crap, apparently on purpose, with enviroment variables.
> 
> This might cause a problem.  Do you think?  I can get them, and since
> this is
> not likely to be a cross-platform program, I may as well use them.
> Are they
> really needed for much, read on though.
> 

Cant see any fundamental problems, but some individual packages use 
environment vars in their own build process. The only one i can think 
of offhand is mozilla if you're building a 'package' from the source, 
but there may be others.

> I intend to produce shell scripts using XSLT instead of exceuting the
> commnads
> individually, thusly. (physdo code)
> 
> get next element.
> check for XSL handler in handlers dir
> 	if FOUND
> 		Pass XML element and children for processing to Xalan
> 		Take returned script and write to /tmp
> 		if ELEMENT ACTIVE (marked as run)
> 			Excute /tmp/tem-script and capture output
> 			Display Output
> 			if LOG_ON
> 				echo output to file
> 			fi
> 	else
> 		if NO-CHILDREN
> 			WARN: No handler for element
> 		else
> 			Recurse Check children
> 		fi
> 	fi
> loop
> 
> I can see it working after a fashion, and avoids the shell
> intercommunication
> problems well.  The problem is chroot.  Will this work.... (physdo
> bash)
> 
> #!/bin/bash
> 
> cp /tmp/current-script $LFS/tmp/current-script
> chroot $LFS /tmp/current-script
> 
> ?
> 
> Where would the output go?  Maybe
> 
> chroot $LFS /tmp/current-script > /tmp/current-log
> cp $LFS/tmp/current-log /tmp
> cat /tmp/current-script
> 
> ?
> 
> Anyway, any help would be gratefully recieved, even if it's only to
> tell me
> that I should give up and learn more programming before trying this.
> Or
> possibly that you don't think Java has a chance.
> 

I think it may be difficult to correct any problems on the fly this 
way, unless the script you produce contains some error checking and 
communication that i wouldn't want to try in bash :) but that said its 
an interesting idea, give it a go and see what comes of it :)

Mark
-- 
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