From 80d1a5ad3ec862c64a3bbe9919d4547340950183 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 Aug 2025 10:40:51 -0400 Subject: 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 Tested-by: Mike Frysinger Reviewed-by: Scott Lee --- release/util.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'release/util.py') 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 @@ """Random utility code for release tools.""" -import os +from pathlib import Path import re import shlex import subprocess @@ -24,8 +24,9 @@ import sys assert sys.version_info >= (3, 6), "This module requires Python 3.6+" -TOPDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -HOMEDIR = os.path.expanduser("~") +THIS_FILE = Path(__file__).resolve() +TOPDIR = THIS_FILE.parent.parent +HOMEDIR = Path("~").expanduser() # These are the release keys we sign with. @@ -54,7 +55,7 @@ def run(opts, cmd, check=True, **kwargs): def import_release_key(opts): """Import the public key of the official release repo signing key.""" # Extract the key from our repo launcher. - launcher = getattr(opts, "launcher", os.path.join(TOPDIR, "repo")) + launcher = getattr(opts, "launcher", TOPDIR / "repo") print(f'Importing keys from "{launcher}" launcher script') with open(launcher, encoding="utf-8") as fp: data = fp.read() -- cgit v1.2.3-54-g00ecf