[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: error: Macro % has illegal name (%define) ?
- From: Marius Feraru <altblue n0i net>
- To: RPM Package Manager <rpm-list redhat com>
- Subject: Re: error: Macro % has illegal name (%define) ?
- Date: Thu, 25 Oct 2007 14:09:26 +0300
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Patrick wrote:
> If I try to run the following script [...]
>
> #!/bin/bash
> cd ~/redhat/SPECS
> BUILDOPTS_libsupertone='--define "_smp_mflags -j1"'
> rpmbuild -ba --target=i386 libsupertone.spec ${BUILDOPTS_libsupertone}
>
> I get this error:
>
> error: Macro % has illegal name (%define)
Not really a RPM issue, but a bash one (and a quite reiterated one on bash
"forums", I may say). Let's rewrite your script:
#!/bin/bash
cd ~/redhat/SPECS
# avoid word splitting on "space"
IFS=$'\n'
# skip quotes, as popt (obviously) won't "dequote" arguments
BUILDOPTS_libsupertone='--define _smp_mflags -j1'
rpmbuild -ba --target=i386 libsupertone.spec ${BUILDOPTS_libsupertone}
# EOF
In the future, when you have bash troubles, try the "easy" debug way:
add "-x" to the shellbang (i.e.: #!/bin/bash -x). It usually helps :)
Try it on your script, you'll see how bash expands your variables.
cheers
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----
iD8DBQFHIHlmtZHp/AYZiNkRAiBJAKCCclEuNTYzYYCrxtJKsIXisIAdywCgqUFQ
eQ+oPMmYphSWxY2YGYkY8Rg=
=fkjM
-----END PGP SIGNATURE-----
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]