rust2rpm: fix crash in sorting of binary targets
The "sort" Jinja2 filter doesn't work because the bins are objects, not strings. This commit changes the sorting to happen correctly, before binary targets are passed to the template for rendering.
This commit is contained in:
parent
08e54604ce
commit
09a496c65e
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import operator
|
||||
import time
|
||||
|
||||
import jinja2
|
||||
|
@ -52,6 +53,9 @@ def spec_file_render(
|
|||
is_bin = len(bins) > 0
|
||||
is_lib = len(libs) > 0
|
||||
|
||||
# sort binaries by name for consistent ordering
|
||||
bins.sort(key=operator.attrgetter("name"))
|
||||
|
||||
kwargs = {
|
||||
"generator_version": __version__,
|
||||
"target": args.target,
|
||||
|
|
|
@ -124,7 +124,7 @@ Requires: {{ req }}
|
|||
{% for file in doc_files %}
|
||||
%doc {{ file }}
|
||||
{% endfor %}
|
||||
{% for bin in bins | sort %}
|
||||
{% for bin in bins %}
|
||||
%{_bindir}/{{ bin.name }}
|
||||
{% endfor %}
|
||||
{% if not only_main %}
|
||||
|
|
Loading…
Reference in a new issue