Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
salt.2642
0038-fix-sorting-by-latest-version-when-called-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0038-fix-sorting-by-latest-version-when-called-with-an-at.patch of Package salt.2642
From cb1dcf81dc43f5b85246ab62a9ab95d96ecd74a1 Mon Sep 17 00:00:00 2001 From: Michael Calmer <mc@suse.de> Date: Mon, 4 Apr 2016 09:49:31 +0200 Subject: [PATCH 38/38] fix sorting by latest version when called with an attribute --- salt/modules/rpm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/modules/rpm.py b/salt/modules/rpm.py index e75bfa4..894cdc1 100644 --- a/salt/modules/rpm.py +++ b/salt/modules/rpm.py @@ -470,6 +470,7 @@ def info(*packages, **attr): "url": "%|URL?{url: %{URL}\\n}|", "summary": "summary: %{SUMMARY}\\n", "description": "description:\\n%{DESCRIPTION}\\n", + "edition": "edition: %|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}\\n", } attr = attr.get('attr', None) and attr['attr'].split(",") or None @@ -483,6 +484,9 @@ def info(*packages, **attr): if 'name' not in attr: attr.append('name') query.append(attr_map['name']) + if 'edition' not in attr: + attr.append('edition') + query.append(attr_map['edition']) else: for attr_k, attr_v in attr_map.iteritems(): if attr_k != 'description': @@ -557,10 +561,11 @@ def info(*packages, **attr): # pick only latest versions # (in case multiple packages installed, e.g. kernel) ret = dict() - for pkg_data in reversed(sorted(_ret, cmp=lambda a_vrs, b_vrs: version_cmp(a_vrs['version'], b_vrs['version']))): + for pkg_data in reversed(sorted(_ret, cmp=lambda a_vrs, b_vrs: version_cmp(a_vrs['edition'], b_vrs['edition']))): pkg_name = pkg_data.pop('name') if pkg_name not in ret: ret[pkg_name] = pkg_data.copy() + del ret[pkg_name]['edition'] return ret -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor