*** empty log message ***

svn path=/trunk/boinc/; revision=10348
This commit is contained in:
David Anderson 2006-06-14 20:17:35 +00:00
parent 231934fafd
commit 51c8c62fa3
5 changed files with 52 additions and 14 deletions

View File

@ -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 <copy_file/>.
Changed it so that it copies any elements it doesn't recognize.
sched/
sched_util.C
tools/
backend_lib.C
dir_hier_path.C

View File

@ -119,6 +119,7 @@ Each such association is represented by an XML element of the form
<file_name>foobar</file_name>
[ <open_name>input</open_name> ]
[ <main_program/> ]
[ <copy_file/> ]
</file_ref>
")."
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 "

View File

@ -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;
}
}

View File

@ -271,29 +271,37 @@ static int process_wu_template(
} else if (match_tag(p, "</workunit>")) {
out += "</workunit>\n";
} else if (match_tag(p, "<file_ref>")) {
file_number = -1;
out += "<file_ref>\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>", file_number)) {
sprintf(buf, " <file_name>%s</file_name>\n",
infiles[file_number]
);
out += buf;
found_file_number = true;
continue;
} else if (parse_str(p, "<open_name>", open_name, sizeof(open_name))) {
sprintf(buf, " <open_name>%s</open_name>\n", open_name);
out += buf;
found_open_name = true;
continue;
} else if (match_tag(p, "</file_ref>")) {
if (file_number < 0) {
if (!found_file_number) {
fprintf(stderr, "No file number found\n");
return ERR_XML_PARSE;
}
sprintf(buf,
"<file_ref>\n"
" <file_name>%s</file_name>\n"
" <open_name>%s</open_name>\n"
"</file_ref>\n",
infiles[file_number],
open_name
);
out += buf;
if (!found_open_name) {
fprintf(stderr, "No open name found\n");
return ERR_XML_PARSE;
}
out += "</file_ref>\n";
break;
} else {
sprintf(buf, "%s\n", p);
out += buf;
}
}
} else if (parse_str(p, "<command_line>", cmdline)) {

View File

@ -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$";