how to tst the "erase " functionality of an rpm

Panu Matilainen pmatilai at
Fri Feb 20 13:00:36 UTC 2009

On Thu, 19 Feb 2009, devzero2000 wrote:

> On Thu, Feb 19, 2009 at 12:03 AM, Jennis Pruett <jennyp at> wrote:
> > I am not allowed "root" on any system, but we build rpms to
> > give to our sysadmins.
> >
> > My problem:  Using my .spec file, I create rpms.
> > But I can't find any way to test what will happen when the rpm
> > is obsolete and the systems folks have to do the rpm -e  rpm_that_I
> > built_at_one_time_in_antoher_life.rpm
> >
> >
> > I can cpio the rpm, and use the rpm -qip to check it. But there is no
> way
> > that I know
> > of, to verify that the erasure will actually remove everything.

Well, generally rpm removes what it knows about. If you're creating files 
from %post and such, try to move that to the package contents. Or if not 
possible, make %ghost files of anything that you expect to get created 
either in scriptlets or software runtime.

> > Anyone have an idea?
> >
> > Thanks,
> > J
> Use a chroot. Most also build in a chroot

Yup, except chroot needs root privilege which is not available here:
> > I am not allowed "root" on any system, but we build rpms to
> > give to our sysadmins.

And mock needs root privileges too to do it's job but it's controllable 
by adding users to group. Whether that's acceptable or not in the 
environment in question is, well, another question.

fakechroot (+ fakeroot) might help somewhat - neither of these requires 
special privileges but then they have limitations to what they can do and 
have some peculiar interactions with how rpm works.

 	- Panu -

More information about the Rpm-list mailing list