- update_versions: get key directory from config file

This commit is contained in:
David Anderson 2012-10-29 11:02:12 -07:00 committed by Oliver Bock
parent c8bc624553
commit f1b4b16bbf
2 changed files with 14 additions and 1 deletions

View File

@ -6438,3 +6438,9 @@ David 28 Oct 2012
client/
app_control.cpp
http_curl.cpp
David 28 Oct 2012
- update_versions: get key directory from config file
tools/
update_versions

View File

@ -31,9 +31,15 @@ $apps = BoincApp::enum("");
$platforms = BoincPlatform::enum("");
$config = file_get_contents("config.xml");
if (!$config) die("config.xml not found. Run this in project root dir.\n");
$download_url = parse_element($config, "<download_url>");
if (!$download_url) die("<download_url> not found in config.xml\n");
$download_dir = parse_element($config, "<download_dir>");
if (!$download_dir) die("<download_dir> not found in config.xml\n");
$fanout = parse_element($config, "<uldl_dir_fanout>");
if (!$fanout) die("<fanout> not found in config.xml\n");
$key_dir = parse_element($config, "<key_dir>");
if (!$key_dir) die("<key_dir> not found in config.xml\n");
function lookup_app($name) {
global $apps;
@ -217,6 +223,7 @@ function confirm_sig_gen($name) {
// process a file
//
function process_file($a, $v, $p, $name, $fds) {
global $key_dir;
$fd = lookup_file($fds, $name);
if (!$fd) {
$fd = null;
@ -236,7 +243,7 @@ function process_file($a, $v, $p, $name, $fds) {
if (is_file($sigpath)) {
$fd->signature = file_get_contents($sigpath);
} else {
$keypath = "keys/code_sign_private";
$keypath = "$key_dir/code_sign_private";
if (is_file($keypath)) {
confirm_sig_gen($name);
$handle = popen("bin/sign_executable $path $keypath", "r");