Re: use of 'date' in rpm .spec %define concats add'l str chars?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 3 Jul 2020 11:09:47 -0700
PGNet Dev <pgnet.dev@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux