Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 985402 Details for
Bug 1156514
[rfe] use dnf instead of yum for fedora-easy-karma
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
use dnf instead of yum
use-dnf-instead-of-yum.patch (text/plain), 3.79 KB, created by
Igor Gnatenko
on 2015-01-28 22:32:17 UTC
(
hide
)
Description:
use dnf instead of yum
Filename:
MIME Type:
Creator:
Igor Gnatenko
Created:
2015-01-28 22:32:17 UTC
Size:
3.79 KB
patch
obsolete
>From 9e499f9b48face1f89986764956f0d93ac33ad75 Mon Sep 17 00:00:00 2001 >From: Igor Gnatenko <i.gnatenko.brain@gmail.com> >Date: Thu, 29 Jan 2015 01:31:21 +0300 >Subject: [PATCH] use dnf instead of yum > >Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1156514 >Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> >--- > fedora-easy-karma.py | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > >diff --git a/fedora-easy-karma.py b/fedora-easy-karma.py >index a3d1285..b0a73f5 100755 >--- a/fedora-easy-karma.py >+++ b/fedora-easy-karma.py >@@ -40,7 +40,7 @@ try: > except ImportError: > pass > >-import yum >+import dnf > > from fedora.client.bodhi import BodhiClient > >@@ -253,7 +253,7 @@ class FedoraEasyKarma(object): > parser.add_option("", "--list-rpms-only", dest="list_rpms_only", help="Only list affected rpms", action="store_true", default=False) > parser.add_option("", "--no-skip-empty-comment", dest="skip_empty_comment", help="Do not skip update if comment is empty", action="store_false", default=True) > parser.add_option("", "--product", dest="product", help="product to query Bodhi for, 'F' for Fedora, 'EL-' for EPEL, default: %default", default="F") >- parser.add_option("", "--releasever", dest="releasever", help="releasever to query Bodhi for, default: releasever from yum", default=None) >+ parser.add_option("", "--releasever", dest="releasever", help="releasever to query Bodhi for, default: releasever from dnf", default=None) > parser.add_option("", "--retries", dest="retries", help="Number if retries when submitting a comment in case of an error, default: %default", default=3, type="int") > parser.add_option("", "--wrap-bugs", dest="wrap_bugs", help="Apply line-wrapping to bugs", action="store_true", default=False) > parser.add_option("", "--wrap-rpms", dest="wrap_rpms", help="Apply line-wrapping to list of installed rpms", action="store_true", default=False) >@@ -293,11 +293,14 @@ class FedoraEasyKarma(object): > self.options.fas_username = fas_username > > bc = BodhiClient(username=self.options.fas_username, useragent="Fedora Easy Karma/GIT", retries=self.options.retries) >- my = yum.YumBase() >- my.preconf.debuglevel = 0 >+ my = dnf.Base() >+ if not dnf.util.am_i_root(): >+ cachedir = dnf.yum.misc.getCacheDir() >+ my.conf.cachedir = cachedir >+ my.fill_sack() > > if not self.options.releasever: >- self.options.releasever = my.conf.yumvar["releasever"] >+ self.options.releasever = dnf.rpm.detect_releasever("/") > release = "%s%s" % (self.options.product, self.options.releasever) > > self.options.datadir = os.path.expanduser(self.options.datadir) >@@ -310,10 +313,8 @@ class FedoraEasyKarma(object): > self.options.installed_min_days) > > self.info("Getting list of installed packages...") >- self.debug("starting yum query") >- # make pkg objects subscriptable, i.e. pkg["name"] work >- yum.rpmsack.RPMInstalledPackage.__getitem__ = lambda self, key: getattr(self, key) >- for pkg in my.rpmdb.returnPackages(): >+ self.debug("starting dnf query") >+ for pkg in my.sack.query().installed(): > installed = datetime.datetime.fromtimestamp(pkg.installtime) > installed_timedelta = now - installed > if installed_timedelta < installed_max_days and installed_timedelta > installed_min_days: >@@ -414,7 +415,7 @@ class FedoraEasyKarma(object): > > if not builds: > print "No testing packages found, you can run "\ >- "'yum update --enablerepo=\"*-testing\"' to install some" >+ "'dnf update --enablerepo=\"*-testing\"' to install some" > for build in builds: > update = testing_builds[build] > >-- >2.2.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1156514
: 985402