#133 make yum.comps a soft dep
Merged 7 years ago by mikem. Opened 7 years ago by mikem.
https://github.com/mikem23/koji-playground.git comps-soft-dep  into  master

make yum.comps a soft dep
Mike McLean • 7 years ago  
cli/koji
file modified
+9 -2
@@ -60,7 +60,10 @@

  import urlgrabber.grabber as grabber

  import urlgrabber.progress as progress

  import xmlrpclib

- import yum.comps

+ try:

+     import yum.comps as yumcomps

+ except ImportError:

+     yumcomps = None

  import optparse

  #for import-comps handler (currently disabled)

  #from rhpl.comps import Comps
@@ -1717,7 +1720,11 @@

      if len(args) != 2:

          parser.error(_("Incorrect number of arguments"))

          assert False

-     comps = yum.comps.Comps()

+     if yumcomps is None:

+         print "yum comps module not available"

+         return 1

+     # TODO: port to libcomps

+     comps = yumcomps.Comps()

      comps.add(args[0])

      tag = args[1]

      force = local_options.force

no initial comment

Only one obscure cli command uses this import, so defer the error until that command is run

@mikem Why not port this to use python-libcomps?

First things first. There is a TODO for that. I have partial work, but it's a little trickier and folks were complaining about the yum dep. Also, epel6 doesn't appear to have libcomps, so we'd probably still want to fall back to this.

@mikem It was never submitted to EPEL6, but at one point it was built for it1. If you want to move to it, it can be built and submitted to EPEL6.

Anyway, porting to libcomps is on my radar. Feel free to file an issue for it if you like :smile:, but in the meantime I'm going to pull this in soon unless there are other objections.

No objections here.

Commit 4250d9a fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

7 years ago
Metadata