[Scons-users] Text suffix in VERSION attribute of Package not supported ?
Nils Olav Selåsdal
noselasd at fiane.mooo.com
Mon Feb 16 12:27:12 EST 2015
On 02/15/2015 11:46 PM, Dirk Bächle wrote:
> 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',
> ...
>
>
Thanks, I can't say I understand quite why the default of
"%(NAME)s-%(VERSION)s" used for the target is significant in relation to
the displayed error - but this "workaround" works fine.
More information about the Scons-users
mailing list