Re: %configure question

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

 



Matthew Miller wrote:
> Bob Proulx wrote:
> > > I want to do something like %configure but with a slightly
> > > different goal.  I'm looking to have a file marked as belonging
> > > to a package so that when I uninstall a package the file is
> > > removed but when I upgrade the package I don't want it to
> > > change.
> > You are talking about different things here.  %configure is a macro
> > that expands to an action usually in the %build script.  But files
> > being part of the package are directives in the %files section.  Those
> > are two unrelated things.
> 
> I think he means %config in the %files section.

Okay.  In that case:

In the %files section, marking a file as %config is probably what you
want.  There are several combinations possible.

 * %config somefile
 * %config(noreplace) somefile
 * %config(missingok) somefile

If a file is marked as a %config file then upon upgrade:

 * if the file on disk was unchanged from the old pristine package
   version then the new pristine config file will replace it.

 * if the pristine config file in the package did not change between
   versions but the on disk file has been modified then rpm leaves the
   file on disk.

 * if the file on disk has been modified from the old pristine package
   version and the file has changed between the old pristine package
   version and the new pristine package version then rpm installs the
   new file and keeps the old one named .rpmsave.

If the file is marked %config(noreplace) but rpm would replace it
given then above rules then the old file will remain in place and the
new one will be renamed .rpmnew.

If the file is marked %config(missingok) then the file does not need
to be included in the rpm but the file if created later, such as
during a %post script, will be counted as a file in the package and
will be removed when the rpm is erased.

However take that description with some caution.  I did not test every
combination.  But I believe that is the right set of behaviors with
those combinations.  If not I am hoping someone on the list will
correct me here.

Bob

_______________________________________________
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