EVR comparison and how to sort them?

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

 



hi,
i'd like to write an automated upgrade script to our packages and i'd
like to know how to retrieve and order EVR's from rpm. suppose i've got
packages with these EVRs:
1.2.3
1.2.4
1.2.5
1.3.0
1.3.1
1:1.4
1:1.5
from each version to the next there is a given script which should have
to run (eg. update config files, database schemes etc) eg:
upgrade-1.2.3-1.2.4
upgrade-1.2.4-1.2.5
upgrade-1.2.5-1.3.0
...
and there are many different server which runs different version of the
given packages. some of them 1.2.3 some of them 1.3.1 and 1:1.4 and now
i'd like to upgrade them to 1:1.5. so in 1:1.5's %post script i'd like
to run all upgrade-x.y.z-a.b.c script in the right order.
how can i do that?
- i'd like to know which was the previously installed version?
- i'd like to select those upgrade-x.y.z-a.b.c scripts which has to be run.
- i'd like to run them in the right order. and of course simple sort is
not enough what's more lexicographical order also not too useful.
is there any way how can i do that with rpm?
is there any tool which can help me? anything better then:
rpm -q --qf "%|SERIAL?{%{SERIAL}:}:{}|%{VERSION}-%{RELEASE}\n"
nobody else has the same problem so far? or everybody do this manually?
it can be done on a few server bug how can be done on hundreds of servers?
thank you for your help in advance.
yours.

-- 
  Levente                               "Si vis pacem para bellum!"
_______________________________________________
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