stages/rpm: sort packages metadata

In order to have a more stable package metadata representation,
sort the generated metadata by name. Adapt the tests' metadata
file to reflect that change.
This commit is contained in:
Christian Kellner 2021-03-16 23:42:50 +00:00 committed by Tom Gundersen
parent b4f58ccc72
commit 1329fc2ca7
2 changed files with 1922 additions and 1917 deletions

View file

@ -37,6 +37,7 @@ import pathlib
import subprocess
import sys
import tempfile
from operator import itemgetter
from osbuild import api
@ -162,7 +163,12 @@ def generate_package_metadata(tree):
raw = res.stdout.strip()
jsdata = '{"packages": [' + raw[:-1] + "]}"
return json.loads(jsdata)
data = json.loads(jsdata)
data["packages"] = sorted(data["packages"],
key=itemgetter("name"))
return data
def disable_dracut(tree):
@ -254,7 +260,6 @@ def main(tree, inputs, options):
subprocess.run(["/bin/sh", "-c", script], check=True)
extra_args = []
if options.get("exclude", {}).get("docs"):

File diff suppressed because it is too large Load diff