aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-07-15 22:56:31 +0200
committerRobin Jarry <robin@jarry.cc>2024-07-15 22:56:31 +0200
commitd13823b8f63a6383ca7a61434f5e57dc37f62f94 (patch)
tree2034feae946f205bff95b4bc54179798df9f46a9 /contrib
parentaa8319bc591f3629b7bfd51caf4ff1a59d11ff4c (diff)
downloadaerc-d13823b8f63a6383ca7a61434f5e57dc37f62f94.tar.gz
depends-diff: only print changes if any
Only print the New, Updated and Removed sections if they contain changes. If there are no dependency changes, only print "none". Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/depends-diff.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/contrib/depends-diff.py b/contrib/depends-diff.py
index 3bccf3de..45376120 100755
--- a/contrib/depends-diff.py
+++ b/contrib/depends-diff.py
@@ -66,33 +66,36 @@ def main():
else:
old_deps[name] = version
- print("## New")
- print()
+ once = False
added = new_deps.keys() - old_deps.keys()
if added:
+ print("## New")
+ print()
for a in sorted(added):
print("+", a, new_deps[a])
- else:
- print("none")
+ once = True
- print()
- print("## Updated")
- print()
updated = old_deps.keys() & new_deps.keys()
if updated:
+ if once:
+ print()
+ print("## Updated")
+ print()
for u in sorted(updated):
print("*", u, old_deps[u], "=>", new_deps[u])
- else:
- print("none")
+ once = True
- print()
- print("## Removed")
- print()
removed = old_deps.keys() - new_deps.keys()
if removed:
+ if once:
+ print()
+ print("## Removed")
+ print()
for r in sorted(removed):
print("-", r)
- else:
+ once = True
+
+ if not once:
print("none")