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 985405 Details for
Bug 1156517
[rfe] use dnf instead of yum
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), 10.94 KB, created by
Igor Gnatenko
on 2015-01-28 22:51:07 UTC
(
hide
)
Description:
use dnf instead of yum
Filename:
MIME Type:
Creator:
Igor Gnatenko
Created:
2015-01-28 22:51:07 UTC
Size:
10.94 KB
patch
obsolete
>From b95485250fe316583dc8e4d1e5477cb1119ccec2 Mon Sep 17 00:00:00 2001 >From: Igor Gnatenko <i.gnatenko.brain@gmail.com> >Date: Thu, 29 Jan 2015 01:49:25 +0300 >Subject: [PATCH] use dnf instead of yum > >Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1156517 >Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> >--- > AUTHORS | 1 + > README.md | 8 +++--- > src/bodhiworker.py | 4 +-- > src/fedora-gooey-karma | 74 +++++++++++++++++++++++++------------------------- > src/packagesworker.py | 12 ++++---- > src/sendkarma.py | 2 +- > 6 files changed, 50 insertions(+), 51 deletions(-) > >diff --git a/AUTHORS b/AUTHORS >index eaa23ad..a40d290 100644 >--- a/AUTHORS >+++ b/AUTHORS >@@ -1,2 +1,3 @@ > Branislav Blaskovic <branislav@blaskovic.sk> > Tomas Meszaros <exo@tty.sk> >+Igor Gnatenko <i.gnatenko.brain@gmail.com> >diff --git a/README.md b/README.md >index 690daf9..c7cd07a 100644 >--- a/README.md >+++ b/README.md >@@ -1,6 +1,6 @@ > # Fedora Gooey Karma > >-fedora-gooey-karma provides similar functionality to the fedora-easy-karma via GUI. It also currently provides some extra info like: yum info, bodhi info, test cases, bugs. >+fedora-gooey-karma provides similar functionality to the fedora-easy-karma via GUI. It also currently provides some extra info like: dnf info, bodhi info, test cases, bugs. > > ## Based on > >@@ -11,8 +11,7 @@ fedora-gooey-karma provides similar functionality to the fedora-easy-karma via G > > python-fedora > fedora-cert >- yum >- yum-utils >+ dnf > bodhi-client > python-pyside > python-keyring >@@ -20,7 +19,7 @@ fedora-gooey-karma provides similar functionality to the fedora-easy-karma via G > > To install these dependencies, use this command: > >- yum install python-fedora fedora-cert yum yum-utils bodhi-client python-pyside python-keyring koji >+ dnf install python-fedora fedora-cert bodhi-client python-pyside python-keyring koji > > ## Installation and usage > >@@ -55,6 +54,7 @@ Please review this script before to adjust paths of rpmbuild and so. > > Branislav Blaskovic <branislav@blaskovic.sk> > Tomas Meszaros <exo@tty.sk> >+ Igor Gnatenko <i.gnatenko.brain@gmail.com> > > ## Blog > >diff --git a/src/bodhiworker.py b/src/bodhiworker.py >index e051f03..5b2d2e8 100644 >--- a/src/bodhiworker.py >+++ b/src/bodhiworker.py >@@ -158,13 +158,13 @@ class BodhiWorker(QtCore.QThread): > # Does this build match with our current build? > if build['nvr'] == package.nvr: > update['itemlist_name'] = package.nvr >- update['yum_package'] = package >+ update['dnf_package'] = package > update['variant'] = 'installed' > return ['installed', update] > # If not, there could be newer version > elif build.package.name == package.name: > update['itemlist_name'] = build['nvr'] >- update['yum_package'] = build.package >+ update['dnf_package'] = build.package > update['variant'] = 'available' > return ['available', update] > >diff --git a/src/fedora-gooey-karma b/src/fedora-gooey-karma >index 496df75..8d4d2dc 100755 >--- a/src/fedora-gooey-karma >+++ b/src/fedora-gooey-karma >@@ -513,9 +513,9 @@ class MainWindow(QtGui.QMainWindow): > # Fill in toolbox Add package line edit > self.ui.tool_pkg_name.setText(bodhi_update['parsed_nvr']['name']) > >- ## yum info >- yum_values = {} >- yum_format_string = ( >+ ## dnf info >+ dnf_values = {} >+ dnf_format_string = ( > "<b>Yum Info %(installed_version)s</b>\n" > "<b> Name:</b> %(name)s\n" > "<b> Installed:</b> %(installed_timedelta)s ago\n" >@@ -531,57 +531,57 @@ class MainWindow(QtGui.QMainWindow): > "\n\n" > ) > >- # Grab yum info from installed package >+ # Grab dnf info from installed package > if bodhi_update.variant == 'installed': >- yum_pkg = bodhi_update.yum_package >+ dnf_pkg = bodhi_update.dnf_package > elif bodhi_update.variant == 'available': > # Search for package > for key in self.__installed_packages.keys(): >- if self.__installed_packages[key].name == bodhi_update.yum_package.name: >- yum_pkg = self.__installed_packages[key] >+ if self.__installed_packages[key].name == bodhi_update.dnf_package.name: >+ dnf_pkg = self.__installed_packages[key] > break > else: >- yum_pkg = None >+ dnf_pkg = None > >- if yum_pkg is not None: >- # If we got yum package >- # fetch info from yum_pkg >- yum_values['name'] = yum_pkg.name >- yum_values['arch'] = yum_pkg.arch >- yum_values['version'] = yum_pkg.version >- yum_values['release'] = yum_pkg.release >+ if dnf_pkg is not None: >+ # If we got dnf package >+ # fetch info from dnf_pkg >+ dnf_values['name'] = dnf_pkg.name >+ dnf_values['arch'] = dnf_pkg.arch >+ dnf_values['version'] = dnf_pkg.version >+ dnf_values['release'] = dnf_pkg.release > > # Calculate install time > now = datetime.datetime.now() >- install_age=(now - datetime.datetime.fromtimestamp(yum_pkg.installtime)) >+ install_age=(now - datetime.datetime.fromtimestamp(dnf_pkg.installtime)) > if install_age.days > 0: >- yum_values['installed_timedelta'] = str(install_age.days) + " days" >+ dnf_values['installed_timedelta'] = str(install_age.days) + " days" > elif install_age.seconds / 60 / 60 > 2: >- yum_values['installed_timedelta'] = str(install_age.seconds / 60 / 60) + " hours" >+ dnf_values['installed_timedelta'] = str(install_age.seconds / 60 / 60) + " hours" > else: >- yum_values['installed_timedelta'] = str(install_age.seconds / 60) + " minutes" >+ dnf_values['installed_timedelta'] = str(install_age.seconds / 60) + " minutes" > > # Calculate package size >- if yum_pkg.packagesize > 1e6: >+ if dnf_pkg.size > 1e6: > # It's better to display human readable number format >- # for the package size, e.g. 1 M (as does $ yum info) >- yum_values['size'] = "{:0.1f} M".format(round(yum_pkg.packagesize/1e6, 1)) >+ # for the package size, e.g. 1 M (as does $ dnf info) >+ dnf_values['size'] = "{:0.1f} M".format(round(dnf_pkg.size/1e6, 1)) > else: >- yum_values['size'] = "{:0.1f} k".format(round(yum_pkg.packagesize/1e3, 1)) >- yum_values['repo'] = yum_pkg.repo >- yum_values['from_repo'] = yum_pkg.ui_from_repo >- yum_values['summary'] = yum_pkg.summary >- yum_values['url'] = yum_pkg.url >- yum_values['license'] = yum_pkg.license >- yum_values['description'] = yum_pkg.description >- yum_values['installed_version'] = '' >+ dnf_values['size'] = "{:0.1f} k".format(round(dnf_pkg.size/1e3, 1)) >+ dnf_values['repo'] = dnf_pkg.repo >+ dnf_values['from_repo'] = dnf_pkg.ui_from_repo >+ dnf_values['summary'] = dnf_pkg.summary >+ dnf_values['url'] = dnf_pkg.url >+ dnf_values['license'] = dnf_pkg.license >+ dnf_values['description'] = dnf_pkg.description >+ dnf_values['installed_version'] = '' > if bodhi_update.variant == 'available': >- yum_values['installed_version'] = '(installed version)' >- # Decode all strings found in yum_values to utf-8 >- self.__decode_dict(yum_values) >- # Map fetched yum info on the yum_format_string >+ dnf_values['installed_version'] = '(installed version)' >+ # Decode all strings found in dnf_values to utf-8 >+ self.__decode_dict(dnf_values) >+ # Map fetched dnf info on the dnf_format_string > # Add to the final browser string >- text_browser_string += yum_format_string % yum_values >+ text_browser_string += dnf_format_string % dnf_values > > ## Related packages > self.ui.treeWidget_related_packages.clear() >@@ -669,11 +669,11 @@ class MainWindow(QtGui.QMainWindow): > > # First descriptions > descriptions_values = {} >- descriptions_values['yum_description'] = yum_values['description'] >+ descriptions_values['dnf_description'] = dnf_values['description'] > descriptions_values['bodhi_notes'] = bodhi_values['notes'].replace('\n', '<br>') > text_browser_descriptions = ( > "<b>Yum description</b></pre>" >- "%(yum_description)s<pre>\n\n" >+ "%(dnf_description)s<pre>\n\n" > "<b>Bodhi update notes</b></pre>" > "%(bodhi_notes)s<pre>\n\n" > ) >diff --git a/src/packagesworker.py b/src/packagesworker.py >index b99eced..60ceb04 100644 >--- a/src/packagesworker.py >+++ b/src/packagesworker.py >@@ -21,12 +21,11 @@ > # Author: Branislav Blaskovic <branislav@blaskovic.sk> > # Author: Tomas Meszaros <exo@tty.sk> > >-import yum >+import dnf > import rpm > import datetime > import koji > from PySide import QtCore >-from yum.misc import getCacheDir > from idlequeue import * > > class PackagesWorker(QtCore.QThread): >@@ -40,9 +39,8 @@ class PackagesWorker(QtCore.QThread): > self.bodhi_workers_queue = bodhi_workers_queue > self.bodhi_workers_count = bodhi_workers_count > >- self.yb = yum.YumBase() >- cachedir = getCacheDir() >- self.yb.repos.setCacheDir(cachedir) >+ self.yb = dnf.Base() >+ self.yb.conf.cachedir = dnf.yum.misc.getCacheDir() > > # RPM Transactions > self.rpmTS = rpm.TransactionSet() >@@ -64,8 +62,8 @@ class PackagesWorker(QtCore.QThread): > self.queue.task_done() > > def load_installed(self, releasever): >- # Load from yum rpmdb all installed packages >- self.installed_packages = self.yb.rpmdb.returnPackages() >+ # Load from dnf sack all installed packages >+ self.installed_packages = self.yb.sack.query().installed().run() > > # Send it to all bodhi_workers > for i in range(self.bodhi_workers_count): >diff --git a/src/sendkarma.py b/src/sendkarma.py >index 342c7a6..129f453 100644 >--- a/src/sendkarma.py >+++ b/src/sendkarma.py >@@ -57,7 +57,7 @@ class SendKarma(threading.Thread): > > # Reload bodhi update > main_thread_call(self.main_thread.bodhi_workers_queue.put, >- ['package_update', self.package['yum_package']]) >+ ['package_update', self.package['dnf_package']]) > # Clean up after sending > main_thread_call(self.main_thread.sending_done, self.username, self.password) > return >-- >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 1156517
: 985405