Skip to content

Commit

Permalink
Construct ZIP files while uploading executables.
Browse files Browse the repository at this point in the history
This is an improvement on top of DOMjudge#2129, since you do not need to check
in ZIP files into a ccsconfig repository, but directories which are
zipped up on the fly.
This makes changing and reviewing changes much easier.
  • Loading branch information
meisterT committed Sep 3, 2023
1 parent f989426 commit 1f68306
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions misc-tools/configure-domjudge.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import json
import os.path
import requests
import requests.utils
import shutil
import sys
from typing import List, Set

Expand Down Expand Up @@ -101,11 +102,15 @@ else:
if os.path.exists('executables'):
executables = []
for file in os.listdir('executables'):
if file.endswith(".zip"):
executables.append(file[:-4])
if executables and dj_utils.confirm('Upload language executables (found: ' + ','.join(executables) + ')?', False):
if os.path.isdir(f'executables/{file}'):
executables.append(file)

if executables:
if dj_utils.confirm('Upload language executables (found: ' + ','.join(executables) + ')?', False):
for langid in executables:
dj_utils.upload_file(f'languages/{langid}/executable', 'executable', f'executables/{langid}.zip')
for langid in executables:
dj_utils.upload_file(f'languages/{langid}/executable', 'executable', f'executables/{langid}.zip')
os.remove(f'executables/{langid}.zip')


if os.path.exists('languages.json'):
Expand Down

0 comments on commit 1f68306

Please sign in to comment.