[Scons-users] how to find dependencies of a given Node?

David Roundy roundyd at physics.oregonstate.edu
Sat Sep 7 08:54:07 EDT 2013


No, the files I want are the graphics files that are required by the tex
file. Most of them are auto-built, and all of them are found by the scons
scanner, presumably using regular expressions to look for
\includegraphics{file/path}. One trickery is that the latex file does not
specify the file extension, so the scons scanner has to look at existing
files and existing rules to determine the proper file name to depend upon.
For the purposes of my tarball, I could assume (as I believe the scons
scanner does) that any non-existing files are pdf files.

David


On Fri, Sep 6, 2013 at 7:33 PM, William Deegan <bill at baddogconsulting.com>wrote:


> David,

>

> Are the files you want listed on the command line to latex when it's run?

>

> -Bill

>

> On Sep 6, 2013, at 6:27 PM, David Roundy <roundyd at physics.oregonstate.edu>

> wrote:

>

> What I really was hopping was that there would be a way to directly access

> the output of the pdflatex Scanner. I know how to write a Scanner by

> creating a function that reads the file and outputs a bunch of strings, and

> was hoping I could just run that function on the latex file. It's not an

> generated file, and thus is available at the beginning of the scons run

> when my code is run. I'm not wanting the full dependency tree, just the

> files that are directly listed in the latex file, which lacks \input{}, and

> thus does not require any recursive reading.

>

> How would a custom builder access the dependency information? I haven't

> seen anything that would do that.

>

> In a pinch I could just write my own scanner, but that seems like a waste

> when scons has a perfectly good latex scanner (except when using beamer,

> which I'm not for these latex files).

>

> David

>

>

> On Fri, Sep 6, 2013 at 4:55 PM, Bill Deegan <bill at baddogconsulting.com>wrote:

>

>> David,

>>

>> It doesn't work that way..

>> Take a read through this.

>> http://scons.org/wiki/SconsProcessOverview

>>

>> A SCons Beginner will often think that the actions listed in the

>> SConstruct/SConscript are executed right away, and that the full dependency

>> tree is available at that point. It's not. The SConstruct/SConscripts tell

>> SCons what to do and with what files, and then SCons builds the dependency

>> tree and processes it.

>>

>> That said, a custom builder may be able to do what you want.

>>

>> -Bill

>>

>>

>> On Fri, Sep 6, 2013 at 3:40 PM, David Roundy <

>> roundyd at physics.oregonstate.edu> wrote:

>>

>>> Hi all,

>>>

>>> I want to create a tarball for a latex file that includes both the file,

>>> and all of its direct dependencies (i.e. the image files included in the

>>> latex, but not the source for those image files). I've been considering

>>> how to implement this, and my best guess is to try something like:

>>>

>>> t = PDF('file.tex')

>>> deps = RunSconsScanner(t)??? # or 'file.tex'?

>>>

>>> # Set TARFLAGS to create a gzip-filtered archive.

>>> env = Environment(TARFLAGS = '-c -z')

>>> for node in [t]+deps:

>>> a = Command(target='archive/'+str(node), source = node,

>>> action=Copy('$TARGET', '$SOURCE'))

>>> env.Tar('file.tar.gz', a)

>>>

>>> The missing bit here is how to ask scons for the dependencies of

>>> 'file.pdf'. Any suggestions?

>>> --

>>> David Roundy

>>>

>>> _______________________________________________

>>> Scons-users mailing list

>>> Scons-users at scons.org

>>> http://four.pairlist.net/mailman/listinfo/scons-users

>>>

>>>

>>

>> _______________________________________________

>> Scons-users mailing list

>> Scons-users at scons.org

>> http://four.pairlist.net/mailman/listinfo/scons-users

>>

>>

>

>

> --

> David Roundy

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>



--
David Roundy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130907/a560d013/attachment.html


More information about the Scons-users mailing list