diff --git a/tools/update_versions b/tools/update_versions index 5f3dbb812fd..74464254173 100755 --- a/tools/update_versions +++ b/tools/update_versions @@ -35,6 +35,7 @@ chdir ("../.."); $apps = BoincApp::enum(""); $platforms = BoincPlatform::enum(""); +$confirm = true; $config = file_get_contents("config.xml"); if (!$config) die("config.xml not found. Run this in project root dir.\n"); @@ -237,7 +238,7 @@ function confirm_sig_gen($name) { // process a file // function process_file($a, $v, $p, $name, $fds) { - global $key_dir; + global $key_dir, $confirm; $fd = lookup_file($fds, $name); if (!$fd) { $fd = new StdClass; @@ -259,7 +260,9 @@ function process_file($a, $v, $p, $name, $fds) { } else { $keypath = "$key_dir/code_sign_private"; if (is_file($keypath)) { - confirm_sig_gen($name); + if ($confirm) { + confirm_sig_gen($name); + } $handle = popen("bin/sign_executable $path $keypath", "r"); $fd->signature = fread($handle, 8192); pclose($handle); @@ -356,7 +359,7 @@ function check_main_program($fds) { return 0; } -function confirm($fds, $v) { +function confirm_update($fds, $v) { echo " Files:\n"; foreach ($fds as $fd) { echo " $fd->physical_name"; @@ -471,8 +474,10 @@ function process_version($a, $v, $p) { $vers->api_version = get_api_version($a, $v, $p, $fds); } - if (!confirm($fds, $vers)) { - return; + if ($confirm) { + if (!confirm_update($fds, $vers)) { + return; + } } $xml = ""; @@ -550,6 +555,10 @@ function scan_apps() { } } +if (count($argv)>1 && $argv[1]=='--noconfirm') { + $confirm = false; +} + scan_apps(); touch("reread_db"); // if feeder is running, tell it to reread DB