[CentOS-devel] Delta RPMs disabled by default?

Wed Jul 9 18:36:11 UTC 2014
Howard Johnson <merlin at mwob.org.uk>

On 09/07/2014 18:14, Les Mikesell wrote:
> On Wed, Jul 9, 2014 at 11:56 AM, Jonathan Dieter <jdieter at gmail.com> wrote:
>> On 07/09/2014 07:38 AM, Les Mikesell wrote:
>>> Is there any way to use deltarpms to get repeatable updates out of
>>> yum?   That is can you tell yum to only use the deltas from a
>>> particular run/time even if newer ones or newer rpm packages exist in
>>> the repository?
>> I've never heard of them used this way, and I don't think the code has
>> been written to do this.  It could possibly be implemented as a yum/dnf
>> plugin.
> So there's no way to force yum to only use deltas - or better, one set
> of deltas?   I've been looking for a sane way to get repeatable
> updates out of yum forever (i.e. update production to match your last
> QA update after testing is complete), and no, I don't consider keeping
> a snapshot copy of a repository in every state that I might want to
> reproduce to be a sane approach.
>

Deltarpms are nothing magical in this regard.  They're a patch (changed 
files, new header data) between RPM N-V1-R1 and N-V2-R2. If yum decides 
it can use a drpm as part of a transaction, it downloads it, and passes 
it to applydeltrarpm.  applydeltarpm reconstructs the RPM N-V2-R2 using 
existing on-disk contents of N-V1-R1 and the drpm.  The reconstructed 
RPM is put into yum's download directory, where the normal package 
installation routines (and librpm) pick it up and install it, no 
differently than if yum had downloaded the entire RPM.  It's just a 
different way of getting that new RPM onto disk, ready for librpm to 
install it.

What you want sounds like a couple of fairly simple python scripts using 
the yum api.  On box A, run a script that dumps a list of installed 
packages, with full N-V-R for each.  Move the list to box B.  Pass it to 
another script that creates a yum transaction to upgrade (or downgrade) 
packages to those versions, and install any missing packages.  For bonus 
points it could remove extra packages it finds.  None of this requires 
drpms.  Hell, if you don't feel like going near the yum api, I reckon 
you could do it with a bash script to generate an input file to pass to 
"yum shell".

Actual implementation of said scripts is of course an exercise for the 
reader ;)  And probably quite a fun and rewarding one, too.

-- 
HJ