Changeset 27459
- Timestamp:
- Mar 26, 2010, 11:18:32 AM (16 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
disttool.c (modified) (9 diffs)
-
disttoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/disttool.c
r27235 r27459 137 137 138 138 // optional 139 PXOPT_LOOKUP_ S64(magic_ds_id, config->args, "-magic_ds_id", false, false);139 PXOPT_LOOKUP_BOOL(use_alternate, config->args, "-use_alternate", false); 140 140 PXOPT_LOOKUP_BOOL(no_magic, config->args, "-no_magic", false); 141 141 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false); … … 145 145 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 146 146 147 PXOPT_LOOKUP_BOOL(dry_run, config->args, "-dry_run", false); 147 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 148 149 if (use_alternate) { 150 if (strcmp(stage, "raw")) { 151 psError(PXTOOLS_ERR_SYS, true, "alternate inputs only supported for raw stage"); 152 return false; 153 } 154 if (no_magic) { 155 psError(PXTOOLS_ERR_SYS, true, "no_magic forbidden with alternate inputs"); 156 return false; 157 } 158 } 148 159 149 160 // select arguments … … 161 172 psString runJoinStr = NULL; 162 173 if (!strcmp(stage, "raw")) { 163 magicRunType = "rawExp"; 164 runJoinStr = "rawExp.exp_id"; 174 if (! use_alternate ) { 175 magicRunType = "rawExp"; 176 runJoinStr = "rawExp.exp_id"; 177 } else { 178 magicRunType = "camRun"; 179 runJoinStr = "camRun.exp_id"; 180 } 165 181 query = pxDataGet("disttool_definebyquery_raw.sql"); 166 182 if (!query) { … … 170 186 } 171 187 172 // for raw stage we select by c hipRun.label because raw labels typically aren't set188 // for raw stage we select by camRun.label and dist_group because rawExp doesn't have those columns 173 189 if (label) { 174 psStringAppend(&query, " AND (c hipRun.label = '%s')", label);190 psStringAppend(&query, " AND (camRun.label = '%s')", label); 175 191 } 176 192 if (dist_group) { 177 psStringAppend(&query, " AND (c hipRun.dist_group = '%s')", dist_group);193 psStringAppend(&query, " AND (camRun.dist_group = '%s')", dist_group); 178 194 } 179 195 } else if (!strcmp(stage, "chip")) { … … 301 317 } 302 318 319 if (!strcmp(stage, "raw")) { 320 if (!no_magic) { 321 psStringAppend(&query, " AND (magicDSRun.re_place = %d)", !use_alternate); 322 psStringAppend(&query, " AND (camRun.state = 'full')"); 323 } 324 } 325 303 326 if (psListLength(where->list)) { 304 327 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); … … 311 334 312 335 if (!no_magic) { 313 psStringAppend(&query, " AND (%s.magicked)", magicRunType); 314 315 // is selecting by magic_ds_id really interesting? 336 psStringAppend(&query, " AND (%s.magicked > 0)", magicRunType); 337 338 #ifdef notdef 339 // XXX: is selecting by magic_ds_id really interesting? I declare no 316 340 if (magic_ds_id) { 317 341 if (!runJoinStr) { … … 324 348 psStringAppend(&query, " AND (magicDSRun.state = 'full' AND magicDSRun.re_place AND (magicDSRun.magic_ds_id = %" PRId64 "))", magic_ds_id); 325 349 } 350 #endif 326 351 } 327 352 … … 352 377 353 378 354 if ( dry_run) {379 if (pretend) { 355 380 if (!ippdbPrintMetadatas(stdout, output, "newdistRuns", true)) { 356 381 psError(PS_ERR_UNKNOWN, false, "failed to print array"); … … 399 424 clean, 400 425 no_magic, 426 use_alternate, 401 427 "new", 402 428 NULL, // time_stamp -
trunk/ippTools/src/disttoolConfig.c
r27184 r27459 49 49 50 50 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-no_magic", 0, "magic is not needed", false); 51 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-use_alternate", 0, "use alternate inputs", false); 51 52 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label", 0, "define label for run", NULL); 52 53 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_note", 0, "select by dist_group", NULL); 53 54 54 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "- dry_run", 0, "don't queue runs just display what would be selected", false);55 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend", 0, "don't queue runs just display what would be selected", false); 55 56 56 57 // select args … … 58 59 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-exp_id", 0, "define exp_id", 0); 59 60 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-chip_id", 0, "define chip_id", 0); 60 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-magic_ds_id", 0, "define chip_id", 0);61 61 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", 0, "select by run label", NULL); 62 62 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-dist_group", 0, "select by dist_group", NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
