On Fri, 3 Jul 2020 11:09:47 -0700
PGNet Dev <pgnet....@gmail.com> wrote:

> on F32,
> 
> date +FORMAT,
>       date +%Y%m%d_%H%M%S
> 
> returns
>       20200703_105351
> 
> 
> 
> as expected.
> 
> in an rpm .spec, if I define
> 
>       %define _build_timestamp %( date +%Y%m%d_%H%M%S )
> 
> and _use_ %{_build_timestamp) _anywhere_ else in the spec, at exec of
> any of rpmbuild/mock build/@COPR etc, it appears as
> 
>       '20200703_105351OURCE'
> 
>                       ?????
> 
> Simply changing the define to
> 
>       %define _build_timestamp %( date +%Y%m%d_%H%M%S | head -c 15 )
> 
> 'fixes' the problem, and use of %{_build_timestamp) correctly returns
> 
>       '20200703_105351'
> 
> 
> 
> Is this a bug in rpmbuild or date? Or a problem in my usage?

Remember that '%' introduces a macro expansion, so if that's not what
you want, you should escape the '%' as '%%':

%define _build_timestamp %( date +%%Y%%m%%d_%%H%%M%%S )


Paul.
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to