summaryrefslogtreecommitdiffstats
path: root/release/util.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2025-08-21 10:40:51 -0400
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2025-08-21 11:16:35 -0700
commit80d1a5ad3ec862c64a3bbe9919d4547340950183 (patch)
treece00fff8d509cb9292dcd0e42922b8235fde224c /release/util.py
parentc615c964fb0c40f1ff2b70681336d0d5d89ddcd7 (diff)
downloadgit-repo-80d1a5ad3ec862c64a3bbe9919d4547340950183.tar.gz
run_tests: add file header checker for licensing blocks
Change-Id: Ic0bfa3b03e2ba46d565a5bc2c1b7a7463b7dca2c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/500103 Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Scott Lee <ddoman@google.com>
Diffstat (limited to 'release/util.py')
-rw-r--r--release/util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/release/util.py b/release/util.py
index c839b872..8596324f 100644
--- a/release/util.py
+++ b/release/util.py
@@ -14,7 +14,7 @@
14 14
15"""Random utility code for release tools.""" 15"""Random utility code for release tools."""
16 16
17import os 17from pathlib import Path
18import re 18import re
19import shlex 19import shlex
20import subprocess 20import subprocess
@@ -24,8 +24,9 @@ import sys
24assert sys.version_info >= (3, 6), "This module requires Python 3.6+" 24assert sys.version_info >= (3, 6), "This module requires Python 3.6+"
25 25
26 26
27TOPDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 27THIS_FILE = Path(__file__).resolve()
28HOMEDIR = os.path.expanduser("~") 28TOPDIR = THIS_FILE.parent.parent
29HOMEDIR = Path("~").expanduser()
29 30
30 31
31# These are the release keys we sign with. 32# These are the release keys we sign with.
@@ -54,7 +55,7 @@ def run(opts, cmd, check=True, **kwargs):
54def import_release_key(opts): 55def import_release_key(opts):
55 """Import the public key of the official release repo signing key.""" 56 """Import the public key of the official release repo signing key."""
56 # Extract the key from our repo launcher. 57 # Extract the key from our repo launcher.
57 launcher = getattr(opts, "launcher", os.path.join(TOPDIR, "repo")) 58 launcher = getattr(opts, "launcher", TOPDIR / "repo")
58 print(f'Importing keys from "{launcher}" launcher script') 59 print(f'Importing keys from "{launcher}" launcher script')
59 with open(launcher, encoding="utf-8") as fp: 60 with open(launcher, encoding="utf-8") as fp:
60 data = fp.read() 61 data = fp.read()