diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-08-03 12:36:01 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2022-08-03 15:24:24 +0200 |
commit | 72bab749e5b21164c2e9c2e792bab754ab2a80f7 (patch) | |
tree | 768d1a5e4f4c816e36d47764d0cfe25c8ba128fd | |
parent | 35030b7618bc195e4cc3ea3dd7ea99b76ca8a4c8 (diff) |
obs: fix_source_format: ignore missing \n
Apparently a \n at the end of debian/source/format is not required, so
don't fix it if it is missing. This avoids printing this confusing line:
osmo-trx: fixing debian/source/format (3.0 (native) => 3.0 (native))
Change-Id: I7f9bb22a389a2109109f7fecd3b7ae0413fe6f5b
-rw-r--r-- | scripts/obs/lib/debian.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/obs/lib/debian.py b/scripts/obs/lib/debian.py index af152da..89153fb 100644 --- a/scripts/obs/lib/debian.py +++ b/scripts/obs/lib/debian.py @@ -59,15 +59,14 @@ def fix_source_format(project): if not os.path.exists(format_path): return - expected = "3.0 (native)\n" - current = open(format_path, "r").read() + expected = "3.0 (native)" + current = open(format_path, "r").read().rstrip() if current == expected: return - print(f"{project}: fixing debian/source/format ({current.rstrip()} =>" - f" {expected.rstrip()})") - open(format_path, "w").write(expected) + print(f"{project}: fixing debian/source/format ({current} => {expected})") + open(format_path, "w").write(f"{expected}\n") def get_last_version_from_changelog(project): |