import os
import re
+import sys
import base64
-import random
import subprocess
import configparser
worker_port = 9990
persistent = False
-other_builds = 0
tree_expire = 0
git_ssh = False
git_ssh_key = None
if ini.has_option("phase2", "persistent"):
persistent = ini.getboolean("phase2", "persistent")
-if ini.has_option("phase2", "other_builds"):
- other_builds = ini.getint("phase2", "other_builds")
-
if ini.has_option("phase2", "expire"):
tree_expire = ini.getint("phase2", "expire")
for section in ini.sections():
if section.startswith("worker "):
if ini.has_option(section, "name") and ini.has_option(section, "password") and \
- ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
+ ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
name = ini.get(section, "name")
password = ini.get(section, "password")
sl_props = { 'shared_wd': False }
line = make.stdout.readline()
if line:
- parse_feed_entry(line)
+ parse_feed_entry(str(line, 'utf-8'))
-with open(work_dir+'/source.git/feeds.conf.default', 'r') as f:
+with open(work_dir+'/source.git/feeds.conf.default', 'r', encoding='utf-8') as f:
for line in f:
parse_feed_entry(line)
+if len(c['change_source']) == 0:
+ log.err("FATAL ERROR: no change_sources defined, aborting!")
+ sys.exit(-1)
####### SCHEDULERS
def GetNumJobs(props):
if props.hasProperty("workername") and props.hasProperty("nproc"):
- return ((int(props["nproc"]) / (max_builds[props["workername"]] + other_builds)) + 1)
+ return ((int(props["nproc"]) / max_builds[props["workername"]]) + 1)
else:
return 1
def UsignSec2Pub(seckey, comment="untrusted comment: secret key"):
try:
seckey = base64.b64decode(seckey)
- except:
+ except Exception:
return None
return "{}\n{}".format(re.sub(r"\bsecret key$", "public key", comment),
if last_build and last_build[0]:
last_complete_at = last_build[0]['complete_at']
if last_complete_at and (last_complete_at > complete_at):
- return last_complete_at
+ return last_complete_at
return complete_at
description = "Uploading source archives",
workdir = "build/sdk",
command = ["rsync", "--files-from=sourcelist", "-4", "--progress", "--checksum", "--delay-updates",
- WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
+ WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
env={'RSYNC_PASSWORD': rsync_src_key},
haltOnFailure = False,
flunkOnFailure = False,