Re: error: Macro % has illegal name (%define) ?

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

 



-----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-----

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux