rhinstaller / fedup

Deprecated Fedora Upgrade tool
GNU General Public License v2.0
23 stars 13 forks source link

Add --distro-sync mode #21

Open wgwoods opened 11 years ago

wgwoods commented 11 years ago

Add a flag to make fedup download and install packages, even if they're older than what's already on the system.

AdamWill commented 9 years ago

So this almost looks really easy - we can just call the distroSyncPkgs() method. But there's one small-yet-big snag: that's not in the __init__.py implementation of the YumBase class; it's in YumBaseCli, the one from cli.py, with a comment:

#  Note that we aren't in __init__ yet for a couple of reasons, but we 
# probably will get there for 3.2.28.

so, yeah, I'm not taking bets on that happening. We could just have fedup's UpgradeDownloader class inherit from YumBaseCli instead of YumBase, but of course that's a pretty big change and might have many other consequences.

Things look better for DNF. At first glance it has the same split, but actually method distro_sync_userlist from class BaseCli calls method distro_sync from class Base; if/when fedup moves to DNF, we can just call distro_sync instead of update in build_update_transaction.

AdamWill commented 9 years ago

Bah. yum's CLI stuff isn't installed as a module at all, it goes to /usr/share/yum-cli , so you can't try inheriting from YumBaseCli at all.

The really ugly hack of dropping the whole distroSyncPkgs method into UpgradeDownloader and changing its return statements to drop the messages, then a single change to build_update_transaction to call self.distroSyncPkgs([]) instead of self.update() actually seems to work in a very quick test, but there's probably no clean way to do that unless we get yum to put the method somewhere fedup can use it sensibly.