From b551503b541f4009b885df9279975b95d32d15cf Mon Sep 17 00:00:00 2001 From: Troy Harvey Date: Sun, 18 Feb 2024 15:08:59 +1100 Subject: [PATCH] Add builddeps sorting Signed-off-by: Troy Harvey --- ybump | 9 +++++++++ yupdate | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/ybump b/ybump index ff3c1fc..40a6458 100755 --- a/ybump +++ b/ybump @@ -30,7 +30,16 @@ if __name__ == "__main__": fp.seek(0) data = ruamel.yaml.round_trip_load(fp) data['release'] += 1 + builddeps = data.get("builddeps") maxwidth = len(max(lines, key=len)) + + if builddeps: + a = sorted(filter(lambda entry: entry.startswith("pkgconfig("), builddeps)) + b = sorted(filter(lambda entry: not entry.startswith("pkgconfig("), builddeps)) + sorted_builddeps = a + b + if builddeps != sorted_builddeps: + data["builddeps"] = sorted_builddeps + try: with open(sys.argv[1], 'w') as fp: ruamel.yaml.round_trip_dump( diff --git a/yupdate b/yupdate index 065cd87..60e083d 100755 --- a/yupdate +++ b/yupdate @@ -100,8 +100,16 @@ if __name__ == "__main__": if args.nb is not None: data['release'] += 1 data['version'] = newversion + builddeps = data.get("builddeps") maxwidth = len(max(lines, key=len)) + if builddeps: + a = sorted(filter(lambda entry: entry.startswith("pkgconfig("), builddeps)) + b = sorted(filter(lambda entry: not entry.startswith("pkgconfig("), builddeps)) + sorted_builddeps = a + b + if builddeps != sorted_builddeps: + data["builddeps"] = sorted_builddeps + try: with open(ymlfile, 'w') as fp: ruamel.yaml.round_trip_dump(