work_dir = os.path.abspath(ini['general'].get("workdir", "."))
scripts_dir = os.path.abspath("../scripts")
-config_seed = inip1.get("config_seed", "")
-
repo_url = ini['repo'].get("url")
repo_branch = ini['repo'].get("branch", "master")
-rsync_bin_url = ini['rsync'].get("binary_url")
-rsync_bin_key = ini['rsync'].get("binary_password")
rsync_bin_defopts = ["-v", "-4", "--timeout=120"]
-if rsync_bin_url.find("::") > 0 or rsync_bin_url.find("rsync://") == 0:
- rsync_bin_defopts += ["--contimeout=20"]
+#if rsync_bin_url.find("::") > 0 or rsync_bin_url.find("rsync://") == 0:
+# rsync_bin_defopts += ["--contimeout=20"]
-rsync_src_url = ini['rsync'].get("source_url")
-rsync_src_key = ini['rsync'].get("source_password")
rsync_src_defopts = ["-v", "-4", "--timeout=120"]
-if rsync_src_url.find("::") > 0 or rsync_src_url.find("rsync://") == 0:
- rsync_src_defopts += ["--contimeout=20"]
+#if rsync_src_url.find("::") > 0 or rsync_src_url.find("rsync://") == 0:
+# rsync_src_defopts += ["--contimeout=20"]
+
+branches = {}
+
+def ini_parse_branch(section):
+ b = {}
+ name = section.get("name")
+
+ if not name:
+ raise ValueError("missing 'name' in " + repr(section))
+ if name in branches:
+ raise ValueError("duplicate branch name in " + repr(section))
+
+ b["name"] = name
+ b["bin_url"] = section.get("binary_url")
+ b["bin_key"] = section.get("binary_password")
-usign_key = None
-usign_comment = "untrusted comment: " + repo_branch.replace("-", " ").title() + " key"
+ b["src_url"] = section.get("source_url")
+ b["src_key"] = section.get("source_password")
-if ini.has_section("usign"):
- usign_key = ini['usign'].get("key")
- usign_comment = ini['usign'].get("comment", usign_comment)
+ b["gpg_key"] = section.get("gpg_key")
-enable_kmod_archive = inip1.getboolean("kmod_archive", False)
+ b["usign_key"] = section.get("usign_key")
+ usign_comment = "untrusted comment: " + name.replace("-", " ").title() + " key"
+ b["usign_comment"] = section.get("usign_comment", usign_comment)
+
+ b["config_seed"] = section.get("config_seed")
+
+ b["kmod_archive"] = section.getboolean("kmod_archive", False)
+
+ branches[name] = b
+ log.msg("Configured branch: {}".format(name))
# PB port can be either a numeric port or a connection string
pb_port = inip1.get("port") or 9989
NetLocks = dict()
for section in ini.sections():
+ if section.startswith("branch "):
+ ini_parse_branch(ini[section])
+
if section.startswith("worker "):
if ini.has_option(section, "name") and ini.has_option(section, "password") and \
(not ini.has_option(section, "phase") or ini.getint(section, "phase") == 1):