diff --git a/checkin_notes b/checkin_notes index 132702639a..d953172537 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5988,3 +5988,14 @@ Rom 14 June 2006 clientgui/ ViewTransfers.cpp +David 14 June 2006 + - tools: dir_hier_path didn't work when the directory already existed. + It would create a new directory with a garbage name. + - tools: process_wu_template(): this wasn't passing through . + Changed it so that it copies any elements it doesn't recognize. + + sched/ + sched_util.C + tools/ + backend_lib.C + dir_hier_path.C diff --git a/doc/xml.php b/doc/xml.php index fe55d9fc27..b521e91888 100644 --- a/doc/xml.php +++ b/doc/xml.php @@ -119,6 +119,7 @@ Each such association is represented by an XML element of the form foobar [ input ] [ ] + [ ] ")." The elements are as follows: @@ -142,6 +143,17 @@ list_item("main_program", "Relevant only for files associated with application versions. It indicates that this file is the application's main program. "); +list_item("copy_file" + " + Use this when an application doesn't use + boinc_resolve_filename() to make logical to physical filenames + (for example, executables without source code). + If present on an input file, + copy the file to the slot directory before starting application. + If present on an output file, + move the file from the slot directory to the project directory + after the application." +); list_end(); echo " diff --git a/sched/sched_util.C b/sched/sched_util.C index 29c3890119..5d4808e3e3 100644 --- a/sched/sched_util.C +++ b/sched/sched_util.C @@ -154,7 +154,8 @@ int dir_hier_path( sprintf(dirpath, "%s/%s", root, dir); if (create) { retval = boinc_mkdir(dirpath); - if (retval && (retval != EEXIST)) { + if (retval && (errno != EEXIST)) { + fprintf(stderr, "boinc_mkdir(%s): retval %d errno %d\n", dirpath, retval, errno); return ERR_MKDIR; } } diff --git a/tools/backend_lib.C b/tools/backend_lib.C index 10802df19d..a7934bb700 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -271,29 +271,37 @@ static int process_wu_template( } else if (match_tag(p, "")) { out += "\n"; } else if (match_tag(p, "")) { - file_number = -1; + out += "\n"; + bool found_file_number = false, found_open_name = false; while (1) { p = strtok(0, "\n"); if (!p) break; if (parse_int(p, "", file_number)) { + sprintf(buf, " %s\n", + infiles[file_number] + ); + out += buf; + found_file_number = true; continue; } else if (parse_str(p, "", open_name, sizeof(open_name))) { + sprintf(buf, " %s\n", open_name); + out += buf; + found_open_name = true; continue; } else if (match_tag(p, "")) { - if (file_number < 0) { + if (!found_file_number) { fprintf(stderr, "No file number found\n"); return ERR_XML_PARSE; } - sprintf(buf, - "\n" - " %s\n" - " %s\n" - "\n", - infiles[file_number], - open_name - ); - out += buf; + if (!found_open_name) { + fprintf(stderr, "No open name found\n"); + return ERR_XML_PARSE; + } + out += "\n"; break; + } else { + sprintf(buf, "%s\n", p); + out += buf; } } } else if (parse_str(p, "", cmdline)) { diff --git a/tools/dir_hier_path.C b/tools/dir_hier_path.C index 8de41ca0a8..c56737f16e 100644 --- a/tools/dir_hier_path.C +++ b/tools/dir_hier_path.C @@ -41,8 +41,14 @@ int main(int /*argc*/, char** argv) { exit(1); } - dir_hier_path(argv[1], "", config.uldl_dir_fanout, path, true); - printf("%s%s\n", config.download_dir, path); + retval = dir_hier_path( + argv[1], config.download_dir, config.uldl_dir_fanout, path, true + ); + if (retval) { + fprintf(stderr, "dir_hier_path(): %d\n", retval); + exit(1); + } + printf("%s\n", path); } const char *BOINC_RCSID_c683969ea8 = "$Id$";