Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_versions: add --noconfirm option #4996

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions tools/update_versions
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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

Expand Down