Skip to content

Commit e8784da

Browse files
committed
Require using --pre-build or --test-build when building with a user target
Signed-off-by: Gaëtan Lehmann <[email protected]>
1 parent 60dcc93 commit e8784da

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/koji/koji_build.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def check_commit_is_available_remotely(dirpath, hash, target, warn):
5050
with cd(dirpath):
5151
if not subprocess.check_output(['git', 'branch', '-r', '--contains', hash]):
5252
raise Exception("The current commit is not available in the remote repository")
53+
try:
54+
if re.match(r'v\d+\.\d+-u-.+', target):
55+
raise Exception(f"Building with a user target requires using --pre-build or --test-build.\n")
56+
except Exception as e:
57+
if warn:
58+
print(f"warning: {e}", flush=True)
59+
else:
60+
raise e
5361
try:
5462
expected_branch = PROTECTED_TARGETS.get(target)
5563
if (
@@ -232,7 +240,7 @@ def main():
232240
+ (['--nowait'] if is_nowait else [])
233241
)
234242
print(' '.join(command), flush=True)
235-
subprocess.check_call(command)
243+
# subprocess.check_call(command)
236244
else:
237245
urls = []
238246
for d in git_repos:

0 commit comments

Comments
 (0)