On Tue, 10 Aug 2010 09:45:00 +1000 (EST), "Timothy Rice" 
<t.r...@ms.unimelb.edu.au> wrote:
>> The attached XSLT should do what you need, although it probably doesn't
>> match the format
>> you would like.  Just run it as:
>>
>> xsltproc --xinclude /path/to/blfs-checkout/index.xml dependencies.xml
> 
> Hey Matt,
> 
> Thanks for that! I wasn't able to get it to work, though :-)

Probably because I gave you the wrong command!  Try:

xsltproc --xinclude dependencies.xsl /path/to/blfs-checkout/index.xml

> But never mind, I've managed to cludge together a different way of
> extracting dependencies from the book's sources, using tools like find,
> grep, and sed.

Ouch, that sounds painful :-)
 
> The problem is that I need to know the specific path to the package in
> advance. For example, for HAL, I need to know that the xml file is
> $BOOK_DIR/general/sysutils/hal.xml.

With the script above, you don't need to know each package's XML file.

You could just pipe it through sed though, to just get the dependencies
for a single package.  Something like this gets you nearly there:

$ xsltproc --xinclude dependencies.xsl \
  /path/to/blfs-checkout/index.xml | sed -n '/^p: tetex$/,/^p:/p'

p: tetex
m: ed
o: libpng
o: x-window-system
o: tk-perl
p: jadetex

(obviously you don't want that last line, but I couldn't figure out
a way to omit that in sed quickly).

My idea with that XSL script was to use its output to populate a sqlite
database and from there it would build up a recursive chain of
dependencies for any given package.

Regards,

Matt.

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to