[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
'Automatic' distro upgrade in rpm
- From: Mariusz Mazur <mmazur kernel pl>
- To: rpm-list redhat com
- Subject: 'Automatic' distro upgrade in rpm
- Date: Fri, 27 Aug 2004 00:40:04 +0200
Here: http://ep09.pld-linux.org/~mmazur/pld-rpm/ver1.patch is the first
version of a patch I'm making. It has one purpose - to allow automatic
upgrade to a new version of any given distro. It does so by introducing a new
field in rpm headers called distversion. The general idea is quite simple -
if a system has package A installed and it's distribution field is eg. 'PLD',
and we're trying to upgrade to package B which also has distribution field
set to 'PLD', *and* our current distribution is in fact PLD, than rpm checks
wether distversion fields are present in both packages. If so, than the
package with higher distversion (as compared by rpmvercmp()) always takes
precedence even if EVR of package A is less than or equal to EVR of installed
package B.
This functionality is meant only to ease upgrades - distversion field is by no
means taken into account in Rs, BRs, etc. By default it's only taken into
account if a package we're trying to upgrade to (and the already installed
one) is in fact meant for the distribution we are currently using - in any
other case rpm behaves as usual. Some defines can modify this behavior, but
that's in the patch for now, I'll document it when I'm finished.
Two things are still missing - many distros use the Distributions field in
rpms not only for the distro name, but also for it's version (eg. 'PLD 1.0
Ra') which means I'll have to add some flexible translation mechanism that
will allow distribution vendors to explicitly state that 'Fedora Core 1' or
sth is just 'Fedora' as far as distversion comparison algorithm is concerned.
The second thing is support for apt-get like tools to also be able to take
distversion field into account (I'll be using poldek as a reference, so don't
count on that functionality to be complete). Currently only command line
install/upgrade is supported (and works :).
Example:
# rpm -q fix-info-dir
fix-info-dir-0.13-6
# rpm -q --queryformat '%{distribution}-%{distversion}\n' fix-info-dir
PLD-2.1
# rpm -qp --queryformat '%{distribution}-%{distversion}\n'
fix-info-dir-0.13-5.i686.rpm
PLD-2.2
# rpm -U fix-info-dir-0.13-5.i686.rpm
# rpm -q fix-info-dir
fix-info-dir-0.13-5
# rpm -U fix-info-dir-0.13-6.i686.rpm
package fix-info-dir-0.13-6 is for older distribution than already
installed fix-info-dir-0.13-5
#
The patch in it's current form is not mergeable, but that should change when
it's completed.
--
In the year eighty five ten
God is gonna shake his mighty head
He'll either say,
"I'm pleased where man has been"
Or tear it down, and start again
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]