- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/ippTools/src
- Files:
-
- 2 edited
-
. (modified) (2 props)
-
disttool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippTools/src
- Property svn:ignore
-
old new 7 7 Makefile.in 8 8 addtool 9 mergetool 9 10 caltool 10 11 camtool
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/eam_branches/ipp-20111122/ippTools/src/disttool.c
r32851 r33638 34 34 static bool updaterunMode(pxConfig *config); 35 35 static bool revertrunMode(pxConfig *config); 36 static bool rerunMode(pxConfig *config);36 static bool startoverMode(pxConfig *config); 37 37 static bool pendingcomponentMode(pxConfig *config); 38 38 static bool addprocessedcomponentMode(pxConfig *config); 39 static bool updateprocessedcomponentMode(pxConfig *config); 40 static bool revertcomponentMode(pxConfig *config); 39 41 static bool revertcomponentMode(pxConfig *config); 40 42 static bool processedcomponentMode(pxConfig *config); … … 84 86 MODECASE(DISTTOOL_MODE_UPDATERUN, updaterunMode); 85 87 MODECASE(DISTTOOL_MODE_REVERTRUN, revertrunMode); 86 MODECASE(DISTTOOL_MODE_ RERUN, rerunMode);88 MODECASE(DISTTOOL_MODE_STARTOVER, startoverMode); 87 89 MODECASE(DISTTOOL_MODE_PENDINGCOMPONENT, pendingcomponentMode); 88 90 MODECASE(DISTTOOL_MODE_ADDPROCESSEDCOMPONENT, addprocessedcomponentMode); 91 MODECASE(DISTTOOL_MODE_UPDATEPROCESSEDCOMPONENT, updateprocessedcomponentMode); 89 92 MODECASE(DISTTOOL_MODE_PROCESSEDCOMPONENT, processedcomponentMode); 90 93 MODECASE(DISTTOOL_MODE_REVERTCOMPONENT, revertcomponentMode); … … 165 168 166 169 PXOPT_LOOKUP_BOOL(single, config->args, "-singlefilter", false); 170 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); 167 171 168 172 if (use_alternate) { … … 404 408 psStringAppend(&query, " AND (camRun.state = 'full')"); 405 409 } 410 } 411 if (!rerun) { 412 psStringAppend(&query, " AND (distRun.dist_id IS NULL)"); 406 413 } 407 414 … … 643 650 } 644 651 645 static bool rerunMode(pxConfig *config)652 static bool startoverMode(pxConfig *config) 646 653 { 647 654 psMetadata *where = psMetadataAlloc(); … … 653 660 654 661 // require data_group or dist_id to be supplied 655 PXOPT_LOOKUP_STR(data_group, config->args, "-data_group", true, false);662 PXOPT_LOOKUP_STR(data_group, config->args, "-data_group", false, false); 656 663 PXOPT_LOOKUP_S64(dist_id, config->args, "-dist_id", false, false); 657 664 if (!data_group && !dist_id) { … … 969 976 return true; 970 977 } 978 static bool updateprocessedcomponentMode(pxConfig *config) 979 { 980 981 // required values 982 PXOPT_LOOKUP_S64(dist_id, config->args, "-dist_id", true, false); 983 PXOPT_LOOKUP_STR(component, config->args, "-component", true, false); 984 985 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 986 PXOPT_LOOKUP_BOOL(clearfault, config->args, "-clearfault", false); 987 PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", false, false); 988 PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false); 989 PXOPT_LOOKUP_STR(outdir, config->args, "-outdir", false, false); 990 PXOPT_LOOKUP_STR(name, config->args, "-name", false, false); 991 992 bool setfault = clearfault || fault; 993 994 if (!bytes && !md5sum && !outdir && !name && !setfault && !fault) { 995 psError(PS_ERR_UNKNOWN, true, "at least one of bytes md5sum outdir name fault or setfault is required"); 996 return false; 997 } 998 999 char *sep = ""; 1000 psString query = psStringCopy("UPDATE distComponent SET "); 1001 if (setfault) { 1002 psStringAppend(&query, "%s fault = %d", sep, fault ? 1 : 0); 1003 sep = ", "; 1004 } 1005 if (bytes) { 1006 psStringAppend(&query, "%s bytes = %d", sep, bytes); 1007 sep = ", "; 1008 } 1009 if (md5sum) { 1010 psStringAppend(&query, "%s md5sum = '%s'", sep, md5sum); 1011 sep = ", "; 1012 } 1013 if (outdir) { 1014 psStringAppend(&query, "%s outdir = '%s'", sep, outdir); 1015 sep = ", "; 1016 } 1017 if (name) { 1018 psStringAppend(&query, "%s name = '%s'", sep, name); 1019 sep = ", "; 1020 } 1021 1022 psStringAppend(&query, "\nWHERE dist_id = %"PRId64 " AND component = '%s'", 1023 dist_id, component); 1024 1025 if (!p_psDBRunQuery(config->dbh, query)) { 1026 psError(PS_ERR_UNKNOWN, false, "database error"); 1027 psFree(query); 1028 return false; 1029 } 1030 psFree(query); 1031 1032 return true; 1033 } 971 1034 972 1035 static bool toadvanceMode(pxConfig *config) … … 1048 1111 psMetadata *where = psMetadataAlloc(); 1049 1112 PXOPT_COPY_S64(config->args, where, "-dist_id", "dist_id", "=="); 1113 PXOPT_COPY_STR(config->args, where, "-component", "component", "=="); 1050 1114 1051 1115 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 2185 2249 psMetadata *where = psMetadataAlloc(); 2186 2250 PXOPT_COPY_S64(config->args, where, "-fs_id", "fs_id", "=="); 2251 PXOPT_COPY_S64(config->args, where, "-dist_id", "dist_id", "=="); 2187 2252 2188 2253 if (!psListLength(where->list)) {
Note:
See TracChangeset
for help on using the changeset viewer.
