Re: Cannot write variable names with the SubstFile builder

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CGxnOLbJm9LxUYDFkgSHNXpqvsBUXZ4-jbLUZBtJaLOoA@mail.gmail.com>
Pretty sure $$ will yield $
Give that a try.

On Tue, Jan 25, 2022 at 8:48 AM Werner Reisberger <[email protected]> wrote:

> The SubstFile builder always expands variable names an ignores any
> escapes.
>
> My SConstruct is:
>
>    env = Environment(tools=['default'])
>    env['prefix'] = '/usr/bin'
>    script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix and
> "${RPM_BUILD_ROOT}"'}
>    env.Substfile('script.in', SUBST_DICT=script_dict,
> SUBSTFILESUFFIX='.spec')
>
> The expected content in script.spec should be:
>
>    prefix:      /bin
>    exec-prefix: /usr/bin and "${RPM_BUILD_ROOT}"
>
> However I am getting:
>
>    prefix:      /bin
>    exec-prefix: /usr/bin and ""
>
> Whatever I try with backslashes doesn't give me the expected result. The
> closest I am coming is
>
>    '@exec_prefix@': '$prefix and "$\{RPM_BUILD_ROOT}" ==> exec-prefix:
> /usr/bin and "$\{RPM_BUILD_ROOT}"
>
> Seems to be a bug for me. Luckily I could replace ${RPM_BUILD_ROOT} with
> %{buildroot} which has the same value in a RPM spec file.
>
> --Werner
>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.