[gnome-build-meta/abderrahim/update-refs-script: 1/2] Add script to update refs
- From: Jordan Petridis <jpetridis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-build-meta/abderrahim/update-refs-script: 1/2] Add script to update refs
- Date: Sat, 15 Oct 2022 14:36:13 +0000 (UTC)
commit 61ead3669fd32e613dca66d70919cacdf63b1794
Author: Abderrahim Kitouni <abderrahim kitouni codethink co uk>
Date: Tue Oct 4 15:49:18 2022 +0200
Add script to update refs
utils/update-refs.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
utils/update_refs.py | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 94 insertions(+)
---
diff --git a/utils/update-refs.py b/utils/update-refs.py
new file mode 100644
index 000000000..3412709a1
--- /dev/null
+++ b/utils/update-refs.py
@@ -0,0 +1,51 @@
+#! /usr/bin/env python3
+
+import argparse
+import os
+import subprocess
+from datetime import datetime
+
+parser = argparse.ArgumentParser()
+parser.add_argument(
+ "--switch-branch", help="Commit to a new branch after tracking", action="store_true"
+)
+args = parser.parse_args()
+
+now = datetime.now()
+
+track_elements = [
+ "core.bst",
+ "flatpak-runtimes.bst",
+ "vm/image.bst",
+ "boards/pinebook-pro/image.bst",
+ "boards/pinephone/image.bst",
+ "boards/pinephone-pro/image.bst",
+ "boards/rock64/image.bst",
+ "boards/raspberrypi-4/image.bst",
+ "vm/repo-devel.bst",
+ "iso/image.bst",
+]
+
+bst_command = os.environ.get("BST", "bst").split()
+
+
+def git(*args):
+ return subprocess.check_call(["git"] + list(args))
+
+
+def bst(*args):
+ return subprocess.check_call(bst_command + ["--no-interactive"] + list(args))
+
+
+bst("track", "--deps", "all", *track_elements)
+
+if parser.switch_branch:
+ git(
+ "switch",
+ "--force-create",
+ "update-bot/" + now.strftime("%F-%H-%M"),
+ )
+
+ git("add", "--update", ".")
+
+ git("commit", "--message", "Update element refs")
diff --git a/utils/update_refs.py b/utils/update_refs.py
new file mode 100755
index 000000000..1e5f02f51
--- /dev/null
+++ b/utils/update_refs.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+from datetime import datetime
+
+now = datetime.now()
+
+track_elements = [
+ "core.bst",
+ "flatpak-runtimes.bst",
+ "vm/image.bst",
+ "boards/pinebook-pro/image.bst",
+ "boards/pinephone/image.bst",
+ "boards/pinephone-pro/image.bst",
+ "boards/rock64/image.bst",
+ "boards/raspberrypi-4/image.bst",
+ "vm/repo-devel.bst",
+ "iso/image.bst",
+]
+
+bst_command = os.environ.get("BST", "bst").split()
+
+
+def git(*args):
+ return subprocess.check_call(["git"] + list(args))
+
+
+def bst(*args):
+ return subprocess.check_call(bst_command + ["--no-interactive"] + list(args))
+
+
+bst("track", "--deps", "all", *track_elements)
+
+git(
+ "switch",
+ "--force-create",
+ "update-bot/" + now.strftime("%F-%H-%M"),
+)
+
+git("add", "--update", ".")
+
+git("commit", "--message", "Update element refs")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]