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

rpm %post - check for version being upgraded

This is a bit of advanced rpm trickery that probably falls in the
"don't do that" category. :-/

Short version:

   How do I query in %post, when executed during an upgrade,
   for the version we are upgrading from?

Long version:

A custom rpm (that OLPC's XS uses to manage configuration) needs to
nuke a dynamically generated config file -
/etc/udev/rules.d/70-persistent-net.rules - _only once_. Before
version 0.5 of the pkg, the script that drove the device naming was
subtly wrong.

The problem is: bad data is almost indistinguishable from good data.
So I can't make the condition just on the bad data, I want to also
check that we're upgrading from a known-bad version.

Users will face a small disruption - any manual tweaks of device
assignation will be lost, but we don't have many users. This will
change soon, so better break it now than later... :-)


 martin langhoff gmail com
 martin laptop org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

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