Skip to content
Snippets Groups Projects
Commit 68755409 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

Make sure the returned value of an executed sh is still a RunningCommand object.

Debian has transitioned to python3.sh 2.x which now returns a true string
breaking our tools. See:
https://github.com/amoffat/sh/blob/develop/MIGRATION.md#return-value-now-a-true-string



Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent 63d1651a
No related branches found
No related tags found
4 merge requests!108Draft: v2026dev2: import-debian-package: stop using a PosixPath object as context manager,!106Draft: import-debian-package: stop using a PosixPath object as context manager,!104Fastforward v2026dev1 -> v2026dev2: Update for compatibility with Trixie,!94Update for compatibility with Trixie
......@@ -176,6 +176,7 @@ def main():
"merge",
"--ff-only",
rebase_tip,
_return_cmd=True,
_ok_code=[0, 128],
_out="/dev/stdout",
_err="/dev/stderr",
......@@ -215,6 +216,7 @@ def main():
args.upstream,
":!debian/changelog",
":!debian/apertis/*",
_return_cmd=True,
_ok_code=[0, 1],
)
msg = [f"Sync from {args.upstream}."]
......
......@@ -91,6 +91,7 @@ def is_minor_change(upstream, downstream):
downstream,
":!debian/changelog",
":!debian/apertis/*",
_return_cmd=True,
_ok_code=[0, 1],
)
return o.exit_code == 0
......@@ -356,6 +357,7 @@ def main():
"--is-ancestor",
upstream_branch,
downstream_branch,
_return_cmd=True,
_ok_code=[0, 1],
).exit_code
== 0
......@@ -435,7 +437,11 @@ def main():
conflicts.append(conflict)
else:
o = git(
"diff", "--quiet", f"HEAD..{downstream_branch}", _ok_code=[0, 1]
"diff",
"--quiet",
f"HEAD..{downstream_branch}",
_return_cmd=True,
_ok_code=[0, 1],
)
if o.exit_code == 0:
print(f"No merge required for {downstream_branch}, skipping ")
......
......@@ -55,7 +55,15 @@ def parse_ref(ref: str) -> str:
def is_ancestor(this: str, other: str):
return (
git("merge-base", "--is-ancestor", this, other, _ok_code=[0, 1]).exit_code == 0
git(
"merge-base",
"--is-ancestor",
this,
other,
_return_cmd=True,
_ok_code=[0, 1],
).exit_code
== 0
)
......@@ -433,6 +441,7 @@ def main():
"merge",
"--ff-only",
local_version_branch,
_return_cmd=True,
_out="/dev/stdout",
_err="/dev/stderr",
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment