I noticed that fedup already actually hacks things up so it can import from yum-cli in textoutput.py, and when you've got an ugly hack, what you want to do is spread it out all through your codebase, right?
So by using the same ugly hack in download.py we can do distro-sync. This looks small but inheriting from YumBaseCli instead of YumBase could have other consequences, we'd need to check carefully what YumBaseCli overrides and see if any of it would affect fedup's behaviour. (No, we can't inherit from YumBase then YumBaseCli so we get extra methods from YumBaseCli but retain YumBase's behaviour for ones they share; I tried, Python doesn't let you). But this does work in a test for me, upgrading a clean F20 desktop install to F21 Workstation.
I didn't make it switchable between 'update' and 'distro-sync' behaviour because it keeps the diff smaller for discussion, and frankly, I still think it's correct to only do 'distro-sync' in fedup. But that of course can be discussed.
This is more of an example / PoC, really. It fixes https://github.com/wgwoods/fedup/issues/21 .
I noticed that fedup already actually hacks things up so it can import from yum-cli in
textoutput.py
, and when you've got an ugly hack, what you want to do is spread it out all through your codebase, right?So by using the same ugly hack in
download.py
we can do distro-sync. This looks small but inheriting from YumBaseCli instead of YumBase could have other consequences, we'd need to check carefully what YumBaseCli overrides and see if any of it would affect fedup's behaviour. (No, we can't inherit fromYumBase
thenYumBaseCli
so we get extra methods fromYumBaseCli
but retainYumBase
's behaviour for ones they share; I tried, Python doesn't let you). But this does work in a test for me, upgrading a clean F20 desktop install to F21 Workstation.I didn't make it switchable between 'update' and 'distro-sync' behaviour because it keeps the diff smaller for discussion, and frankly, I still think it's correct to only do 'distro-sync' in fedup. But that of course can be discussed.