[Scons-users] Text suffix in VERSION attribute of Package not supported ?

Dirk Bächle tshortik at gmx.de
Sun Feb 15 17:46:08 EST 2015

Hi Nils,

On 15.02.2015 21:27, Nils Olav Selåsdal wrote:
> I'm trying to use a non-number suffix in the VERSION of a Package(),
> below is a small SConstruct example:
> env = Environment(tools = ['default', 'packaging'])
> dummy = env.Command('dummy', None, 'touch dummy')
> env.Install('/tmp', dummy)
> env.Package(NAME           = 'pkg-test',
>               VERSION        = '1.0-alpha',
>               PACKAGEVERSION = 1,
>               PACKAGETYPE    = 'targz',
> )
> This works fine if VERSION ends with a digit, e.g. '1.0' Or even 'alpha1.0'.
> [...]
> Can I not end the VERSION with non-digits, what's the restrictions ? Or
> is this a bug ?

the restriction is, that SCons selects the string "%(NAME)s-%(VERSION)s" as default name for the target *and* the PACKAGEROOT if you 
don't specify them. That's where the message about "File vs. Dir" lookup comes from.
As a workaround, give the full target and also pass "source" from the SConstruct like this:

   env.Package( target = 'pkg-test-1.0-alpha.tar.gz',
                source = env.FindInstalledFiles(),
                NAME           = 'pkg-test',
                VERSION        = '1.0-alpha',

I'll try to look deeper into the sources during the next week, but this should get you going again. Not sure if there's a real bug 
anywhere, but env.Package() should actually work with any combination of NAME/VERSION.

Best regards,


More information about the Scons-users mailing list