Bruno Galindro da Costa wrote:
I´m building a RPM package and I need to check if a user exists
before install the package. If user exists, the script will create
him in the system. Before I compile then, I´ve tried to install it,
but the following error is displayed. Is this because I´ve putted a
%define into the %pre section? How can I define a variable that I
%can use on the %defattr directive inside %pre section?
I don't think you can do what you want with rpm. By the time the %pre
scriptlet is running, the %defattr in the %files section is long since
set. You could use chgrp in %post to fix up the group ownership of
the files, which will make rpm complain if you run --verify against
this package.
There's probably a better way to handle this if you're willing and
able to change more than just this one package. It seems to me that
needing to do this seems like a good indication that something else is
wrong.
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL:
www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All I really want for Christmas is Santa's list of Naughty Girls.