Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 06/09/2018 07:13 AM, Phil Perry wrote: > On 08/06/18 22:54, lejeczek wrote: >> >> >> On 08/06/18 19:38, Phil Perry wrote: >>> On 08/06/18 15:54, lejeczek wrote: hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L >>> >>> I'm not sure what you are trying to define above. >>> >>> Normal convention where one wishes to define _foobar as "foo" for >>> example would be: >>> >>> rpmbuild --define '_foobar foo' >>> >>> or generically >>> >>> rpmbuild --define 'SomeVariable SomeValue' >>> >>> Hope that helps >> >> Try to pass bash var to rpmbuild, eg: >> >> $ _def1="_me no" >> $ rpmbuild --define ${_def1} >> >> > > I assume you are doing this in a bash script? > > ${_def1} may need to be quoted as it contains a space. > > But for that I would do the following to make it more readable: > > ME="no" > rpmbuild --define '_me ${ME}' > > > or if ${ME} contains spaces: > > rpmbuild --define '_me "${ME}"' Most of the time, bash will not replace variables inside single quotes, so I am not sure that would work. I use for my mock script: mock --configdir=$configdir -D "dist $dist" -r $mock_cfg It seems not to get confused with double quotes there .. but it puts in the literal value $dist if I use single quotes. signature.asc Description: OpenPGP digital signature ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 11/06/18 17:32, Jonathan Billings wrote: On Mon, Jun 11, 2018 at 05:00:11PM +0100, lejeczek wrote: none of of these work for me, like I said earlier I fiddle a bit with it. I was hoping someone could confirm this and then maybe it's a bug? This sounds like you're running into bash quoting issues, not a bug in rpmbuild. Are you running these commands in a shell script? Is it executed from a non-interactive service? Everything in bash script. It actually might be working. What I did was I was looking for a confirmation like this: $ ps -FC rpmbuild --cols UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD appmgr 24855 24835 0 44512 6772 16 17:33 pts/000:00:00 rpmbuild --define "_MKL 1" --define "_mic 1" waiting to see those quotation marks(single or double) in there, but.. it turns out that it works actually when ps is not showing them, like: $ ps -FC rpmbuild --cols UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD appmgr 24855 24835 0 44512 6772 16 17:33 pts/000:00:00 rpmbuild --define _MKL 1 --define _mic 1 and then vars(in a bash script, all in such a script) are simply declared: ... export _definition1='_MKL 1' rpmbuild --define "${_definition1}" --define "${_definition2}" without! any escaping of quotes. ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On Mon, Jun 11, 2018 at 05:00:11PM +0100, lejeczek wrote: > none of of these work for me, like I said earlier I fiddle a bit with it. I > was hoping someone could confirm this and then maybe it's a bug? This sounds like you're running into bash quoting issues, not a bug in rpmbuild. Are you running these commands in a shell script? Is it executed from a non-interactive service? -- Jonathan Billings ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 09/06/18 13:13, Phil Perry wrote: On 08/06/18 22:54, lejeczek wrote: On 08/06/18 19:38, Phil Perry wrote: On 08/06/18 15:54, lejeczek wrote: hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L I'm not sure what you are trying to define above. Normal convention where one wishes to define _foobar as "foo" for example would be: rpmbuild --define '_foobar foo' or generically rpmbuild --define 'SomeVariable SomeValue' Hope that helps Try to pass bash var to rpmbuild, eg: $ _def1="_me no" $ rpmbuild --define ${_def1} I assume you are doing this in a bash script? ${_def1} may need to be quoted as it contains a space. But for that I would do the following to make it more readable: ME="no" rpmbuild --define '_me ${ME}' or if ${ME} contains spaces: rpmbuild --define '_me "${ME}"' none of of these work for me, like I said earlier I fiddle a bit with it. I was hoping someone could confirm this and then maybe it's a bug? ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 08/06/18 22:54, lejeczek wrote: On 08/06/18 19:38, Phil Perry wrote: On 08/06/18 15:54, lejeczek wrote: hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L I'm not sure what you are trying to define above. Normal convention where one wishes to define _foobar as "foo" for example would be: rpmbuild --define '_foobar foo' or generically rpmbuild --define 'SomeVariable SomeValue' Hope that helps Try to pass bash var to rpmbuild, eg: $ _def1="_me no" $ rpmbuild --define ${_def1} I assume you are doing this in a bash script? ${_def1} may need to be quoted as it contains a space. But for that I would do the following to make it more readable: ME="no" rpmbuild --define '_me ${ME}' or if ${ME} contains spaces: rpmbuild --define '_me "${ME}"' ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 08/06/18 19:38, Phil Perry wrote: On 08/06/18 15:54, lejeczek wrote: hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L I'm not sure what you are trying to define above. Normal convention where one wishes to define _foobar as "foo" for example would be: rpmbuild --define '_foobar foo' or generically rpmbuild --define 'SomeVariable SomeValue' Hope that helps Try to pass bash var to rpmbuild, eg: $ _def1="_me no" $ rpmbuild --define ${_def1} ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] rpmbuild --define | some rpm sorcerer around?
On 08/06/18 15:54, lejeczek wrote: hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L I'm not sure what you are trying to define above. Normal convention where one wishes to define _foobar as "foo" for example would be: rpmbuild --define '_foobar foo' or generically rpmbuild --define 'SomeVariable SomeValue' Hope that helps ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
[CentOS] rpmbuild --define | some rpm sorcerer around?
hi how do you pass vars to rpmbuild for definition? eg rpmbuild --define \'"${_definition2}"\' I've been fiddling with ways to escape, but none is fricking working.. I mean, rpmbuild rushes to work(no errors nor failure) so if you try just the command line do not believe it, because later as it executes %if you will see process does not see these definitions. many thanks, L ___ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos