mirror of https://github.com/BOINC/boinc.git
- upgrade script:
- prompt user for DB user/passwd if DB updates needed - error out immediately if any DB update fails Fixes #1169, #1170 - create_work: check for duplicate <file_info>s in input template NOTE: the input template syntax is pretty clunky svn path=/trunk/boinc/; revision=24969
This commit is contained in:
parent
bba4ce24ce
commit
33b607dab1
|
@ -68,3 +68,19 @@ David 2 Jan 2012
|
|||
cs_prefs.cpp
|
||||
cs_scheduler.cpp
|
||||
cpu_sched.cpp
|
||||
|
||||
David 2 Jan 2012
|
||||
- upgrade script:
|
||||
- prompt user for DB user/passwd if DB updates needed
|
||||
- error out immediately if any DB update fails
|
||||
Fixes #1169, #1170
|
||||
- create_work: check for duplicate <file_info>s in input template
|
||||
NOTE: the input template syntax is pretty clunky
|
||||
|
||||
tools/
|
||||
process_input_template.cpp
|
||||
html/
|
||||
ops/
|
||||
upgrade_db.php
|
||||
inc/
|
||||
util_ops.inc
|
||||
|
|
|
@ -104,19 +104,18 @@ function db_init_cli() {
|
|||
$host = "localhost";
|
||||
}
|
||||
$in = fopen("php://stdin","r");
|
||||
print "Database username for $db_name@$host: ";
|
||||
print "Database username (if not current user): ";
|
||||
$user = rtrim(fgets($in, 80));
|
||||
print "Database password for $db_name@host: ";
|
||||
print "Database password (if any): ";
|
||||
$pass = rtrim(fgets($in, 80));
|
||||
|
||||
$retval = mysql_pconnect($host, $user, $pass);
|
||||
if (!$retval) {
|
||||
return 1;
|
||||
die("Can't connect to DB\n");
|
||||
}
|
||||
if (!mysql_select_db($db_name)) {
|
||||
return 2;
|
||||
die("Can't select DB\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function print_login_form_ops($next_url='') {
|
||||
|
|
|
@ -58,6 +58,8 @@ if ($argc > 1) {
|
|||
echo "\nWarning: you are upgrading only web or server code,\nbut these updates may affect the other code as well.\nWe recommend that you run 'upgrade' again to upgrade both parts of the code.\n\n";
|
||||
}
|
||||
|
||||
db_init_cli();
|
||||
|
||||
foreach($updates as $update) {
|
||||
list($rev, $func) = $update;
|
||||
echo "performing update $func\n";
|
||||
|
|
|
@ -132,6 +132,8 @@ static void write_md5_info(
|
|||
return;
|
||||
}
|
||||
|
||||
static bool input_file_found[1024];
|
||||
|
||||
static int process_file_info(
|
||||
XML_PARSER& xp, string& out, int ninfiles, const char** infiles,
|
||||
SCHED_CONFIG& config_loc
|
||||
|
@ -176,6 +178,13 @@ static int process_file_info(
|
|||
);
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
if (input_file_found[file_number]) {
|
||||
fprintf(stderr,
|
||||
"Input file %d listed twice\n", file_number
|
||||
);
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
input_file_found[file_number] = true;
|
||||
if (generated_locally) {
|
||||
sprintf(buf,
|
||||
" <name>%s</name>\n"
|
||||
|
@ -382,6 +391,10 @@ int process_input_template(
|
|||
bool found_workunit=false;
|
||||
int nfiles_parsed = 0;
|
||||
|
||||
for (int i=0; i<1024; i++) {
|
||||
input_file_found[i] = false;
|
||||
}
|
||||
|
||||
out = "";
|
||||
MIOFILE mf;
|
||||
XML_PARSER xp(&mf);
|
||||
|
|
Loading…
Reference in New Issue