osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/41393?usp=email )
Change subject: OBS: sync_obs_projects: fix for OSC 1.12.1 ......................................................................
OBS: sync_obs_projects: fix for OSC 1.12.1
Since the Docker image used by sync_obs_projects was changed from Debian 12 to 13, several "osc" commands have in their output:
fatal: not a git repository (or any of the parent directories): .git
Work around this by switching to the temp directory and initializing a git repository there, with an "origin" remote that osc also expects to exist.
Fixes: 6ac535b8 ("OBS: set default distro to debian 13") Change-Id: I1236a065e2998fb46343df3968f7bb4dabeea55a --- M scripts/obs/sync_obs_projects.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
diff --git a/scripts/obs/sync_obs_projects.py b/scripts/obs/sync_obs_projects.py index d494ed4..a82a47c 100755 --- a/scripts/obs/sync_obs_projects.py +++ b/scripts/obs/sync_obs_projects.py @@ -334,6 +334,12 @@
os.makedirs(lib.config.path_temp, exist_ok=True)
+ # OSC 1.12.1 from Debian Trixie fails if the current working dir isn't a + # git repository or is missing an "origin" remote + os.chdir(lib.config.path_temp) + lib.run_cmd(["git", "init"]) + lib.run_cmd(["git", "remote", "add", "origin", "."]) + # Get destination OBS projects lib.osc.set_apiurl(lib.args.to_apiurl, None) dest_projects = lib.osc.get_projects()