[Scons-users] Repositories and rstr/rfile

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Thu May 15 03:52:06 EDT 2014


Sorry, my reply got lost somewhere I think (posibly by me)

This doesn't work. The .rsrcpath on exists for $SOURCE and presumably $TARGET

The underlying problem appears to be that when you are using a repository, if you have a build that copies stuff from the repository directly to the build directory then there's no way of finding out the original file when you do a build.

Node.srcifle etc etc all assume if the file exists then that's the file to use, and only if it doesn't exist should you search in the repository.

Now, I'm not entirely sure that a build rule where the target name and the source name are effectively identical is a sane rule, but it is allowed, even if messy.

I just wonder if
a) The person who wrote this is being rather silly and should be persuaded to do something else
b) scons should warn/error if you do something like that
c) scons should have something that given a Node, returns you the filename from the repository irrespective of whether the file exists in the build directory

Any help/advice gratefully received

----- Original Message -----
From: dl9obn at darc.de
To: scons-users at scons.org
At: May 13 2014 17:42:05

Tom,

On 13.05.2014 15:30, Tom Tanner (BLOOMBERG/ LONDON) wrote:

> Someone has decided that it'd be a good thing to have a file in a

> repository (i.e. scons -Y <repo>) which gets copied unchanged into the

> build directory at the same location. Thus he has code of the general

> form:

>

> Import('*')

>

> for f in Glob('some.config.*'):

> Depends('test.pcv', Command(f, f.rfile(), Copy('$TARGET', '$SOURCE')))

>

> Except this doesn't work, because the 2nd time you do a build, f and

> f.rfile() are now the same thing. As far as I can tell this is only

> related to repositories.

>

> Choices seem to be:

> 1) use os.path.join(path-to-repo, f) instead of f.rfile() or f.abspath

> or f.prettymuchanything()

> 2) Tell him to do something different, like not use the same names.

> This sort of breaks down as he claims something similar works if he's

> not using a repository.

> 3) I'm missing some easy way of finding out the actual source of an

> item in a repository

>

please have a look at the MAN page, section "Variable Substitution". The
".rsrcpath" attribute/method might be what you're looking for.

Regards,

Dirk


----------------------------

_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users



More information about the Scons-users mailing list