Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 937445 Details for
Bug 1141634
dnf.Base.query.filter() segfaults
[?]
New
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.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
script to reproduce the issue
dnf-test.py (text/plain), 2.71 KB, created by
Tim Lauridsen
on 2014-09-15 05:42:39 UTC
(
hide
)
Description:
script to reproduce the issue
Filename:
MIME Type:
Creator:
Tim Lauridsen
Created:
2014-09-15 05:42:39 UTC
Size:
2.71 KB
patch
obsolete
># -*- coding: utf-8 -*- > >from __future__ import print_function >from __future__ import absolute_import > >import dnf > >pkg_list = ['libertas-usb8388-firmware,2,20140912,39.git365e80cce.fc21,noarch,updates-testing', >'libcacard,2,2.1.1,1.fc21,x86_64,updates-testing', >'linux-firmware,0,20140912,39.git365e80cce.fc21,noarch,updates-testing', >'xorg-x11-xinit,0,1.3.4,1.fc21,x86_64,updates-testing', >'qemu-common,2,2.1.1,1.fc21,x86_64,updates-testing', > 'qemu-guest-agent,2,2.1.1,1.fc21,x86_64,updates-testing'] > >class DnfBase(dnf.Base): > ''' > class to encapsulate and extend the dnf.Base API > ''' > > def __init__(self, setup_sack=True): > dnf.Base.__init__(self) > # setup the dnf cache > self.setup_cache() > # read the repository infomation > self.read_all_repos() > if setup_sack: > # populate the dnf sack > self.fill_sack() > > def setup_base(self): > self.fill_sack() > > def cachedir_fit(self): > conf = self.conf > subst = conf.substitutions > # this is not public API, same procedure as dnf cli > suffix = dnf.conf.parser.substitute(dnf.const.CACHEDIR_SUFFIX, subst) > cli_cache = dnf.conf.CliCache(conf.cachedir, suffix) > return cli_cache.cachedir, cli_cache.system_cachedir > > def setup_cache(self): > """Setup the dnf cache, same as dnf cli""" > conf = self.conf > conf.substitutions['releasever'] = dnf.rpm.detect_releasever('/') > conf.cachedir, self._system_cachedir = self.cachedir_fit() > print("cachedir: %s", conf.cachedir) > > >class DnfExample(DnfBase): > ''' > This example shows how to get packages matching a given > package name. > ''' > > def __init__(self): > DnfBase.__init__(self) > print('======= find pkgs by id ======') > for pkg_id in pkg_list: > po = self._get_po(pkg_id) > print(' --> %s' % str(po)) > print("======= The End ======") > > > def _get_po(self, id): > """Get the package from given package id.""" > n, e, v, r, a, repo_id = id.split(',') > q = self.sack.query() > if repo_id.startswith('@'): # installed package > f = q.installed() > f = f.filter(name=n, version=v, release=r, arch=a) > if len(f) > 0: > return f[0] > else: > return None > else: > f = q.available() > f = f.filter(name=n, arch=a, version=v, release=r) > print('f.filter(name=%s, version=%s, release=%s, arch=%s)' % (n,v,r,a)) > if len(f) > 0: > print(' --> Found : %s' % f[0]) > return f[0] > else: > return None > >if __name__ == "__main__": > de = DnfExample() > del de > >
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 Raw
Actions:
View
Attachments on
bug 1141634
:
937429
|
937430
|
937431
|
937432
|
937433
|
937434
|
937435
|
937436
|
937437
|
937438
|
937439
|
937440
|
937441
| 937445