summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jolly <kangie@gentoo.org>2024-03-21 07:44:52 +1000
committerMatt Jolly <kangie@gentoo.org>2024-03-21 07:44:52 +1000
commitb78a5ed24c78b4f55923164346b517eccf5e9390 (patch)
tree7e9f1e10ddf6f85da7da316cc5a1a573bb82189f
parentchrome-bump: Add some hacky logic to update chromedriver-bin with chrome stable (diff)
downloadchromium-tools-b78a5ed24c78b4f55923164346b517eccf5e9390.tar.gz
chromium-tools-b78a5ed24c78b4f55923164346b517eccf5e9390.tar.bz2
chromium-tools-b78a5ed24c78b4f55923164346b517eccf5e9390.zip
Add script to generate new gn version and tarball from git
Signed-off-by: Matt Jolly <kangie@gentoo.org>
-rwxr-xr-xbump-gn.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/bump-gn.sh b/bump-gn.sh
new file mode 100755
index 0000000..1b49138
--- /dev/null
+++ b/bump-gn.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# This script actually only creates an appropriately-versioned GN tarball to assist
+# in the process of bumping the GN version. It does not actually bump the GN version
+# in the gentoo tree as we need to upload the tarball to a devspace.
+
+# Users should set the following to make xz work:
+# git config --global tar.tar.xz.command "xz -T0 -9 -c"
+
+# check if /tmp/gn exists and if so delete it
+if [ -d /tmp/gn ]; then
+ rm -rf /tmp/gn
+fi
+
+# Clone the gn repo
+git clone https://gn.googlesource.com/gn /tmp/gn
+
+pushd /tmp/gn
+
+commit=$(git describe --tags)
+pattern="([^-]*)-([^-]*)-([^-]*)-(.*)"
+[[ $commit =~ $pattern ]]
+count="${BASH_REMATCH[3]}"
+
+git archive --format=tar.xz --prefix=gn-0.${count}/ -o /tmp/gn-0.${count}.tar.xz HEAD
+
+popd
+
+echo "Tarball created at /tmp/gn-0.${count}.tar.xz"