osmith has uploaded this change for review. (
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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/41393/1
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()
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41393?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I1236a065e2998fb46343df3968f7bb4dabeea55a
Gerrit-Change-Number: 41393
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>