[gnome-build-meta/abderrahim/update-refs-script] Add script to update refs




commit df162817ac224fcafd2c425578bcc40ceedcd70f
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 | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
---
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]