diff --git a/rust2rpm/generator.py b/rust2rpm/generator.py index e01c1b5..76875f7 100644 --- a/rust2rpm/generator.py +++ b/rust2rpm/generator.py @@ -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, diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec index b39df3b..13b9bfd 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec @@ -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 %}