Re: Re: How to handle erasing an RPM that contains a mandatory file

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

 



You could also copy the file instead of moving it.  maybe even add a
trigger so if the file is removed when another package (the one that
originally provided it) gets removed or reinstaled it'll recopy it.

~Tom

On 10/27/06, Fulko.Hew@xxxxxxxxx <Fulko.Hew@xxxxxxxxx> wrote:


rpm-list-bounces@xxxxxxxxxx wrote on 10/27/2006 10:34:58 AM:

> This is a philosophical question as well as a technical question...
>
> I've build an RPM for 'my' version of 'bash'.
>
> But (for other technical reasons) someone in the future will
> eventually issue an 'rpm -e bash' during our upgrade procedure,
> which will attempt to remove the bash binary file.  But...
> a) a lot of other packages are dependant on bash, and b) without
> at least some version of bash, the system will probably come
> crashing to a halt.  :-(
>
> What is the recommended technique to:
>
> a) allow 'rpm -e bash' and avoid the dependency complaint/failure?
> b) prevent the binary from being removed during package removal?
>    or how can you maintain a copy of the binary across package removal.
>
> And can all this be done within the spec file?

A follow-up to my own post...

Both problems can be solved using one solution.

a) the dependent file is originally created as a different name
   (thereby preventing the dependency on the 'real' filename.
b) by using a different name, only the 'different' name is removed
   and not the mandatory file.
c) a %post block to move the 'different' file to its proper location
d) a %preun block, that creates/touches the 'different' file to avoid
   error messages during rpm -e (and eliminates the need for disk
   space holding the extra copy of the file).


ie.

%install
install -m 755 src/bash ${buildroot}/bin/bash.copy

%files
/bin/bash.copy

%post
mv /bin/bash.copy /bin/bash

%preun
touch /bin/bash.copy




This document is strictly confidential and intended only for use by the addressee unless otherwise stated.  If you are not the intended recipient, please notify the sender immediately and delete it from your system.


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


_______________________________________________
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