Upgrading breaks files

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

 



Hello,

for reasons I won't go into here, I have a package that installs a
file under /etc/package/file.instancename, then the postinst script
appends the contents of that file to another (pre-existing) file on
the filesystem (say, /etc/mainfile). Similarly, the preun script
removes that block of data from the main file and leaves it as it was
before the installation. This works nicely and allows us to install
multiple instances of the package, each one contributing its own
fragment to the main file, and without interfering with each other.
The postinst script is carefully designed to do the right thing and
not add the fragment twice (essentially, it either deletes the
existing fragment in /etc/mainfile and readds the package-provided
one, or doesn't touch it, depending on configuration parameters; but
it does work ok).

This breaks when someone uses rpm -U to upgrade, since it's equivalent
to running rpm -i followed by rpm -e, which means that the postun
script is ran last, so the end result is that the instance-specific
fragment is missing from mainfile after the upgrade.

How do people usually deal with this kind of situations?
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/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