Changeset 21463 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Feb 13, 2009, 8:51:50 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r21402 r21463 42 42 static bool revertprocessedimfileMode(pxConfig *config); 43 43 static bool updateprocessedimfileMode(pxConfig *config); 44 static bool promoteexpMode(pxConfig *config); 44 45 static bool blockMode(pxConfig *config); 45 46 static bool maskedMode(pxConfig *config); … … 54 55 static bool topurgedimfileMode(pxConfig *config); 55 56 56 static bool chipProcessedCompleteExp(pxConfig *config);57 58 57 # define MODECASE(caseName, func) \ 59 58 case caseName: \ … … 80 79 MODECASE(CHIPTOOL_MODE_REVERTPROCESSEDIMFILE, revertprocessedimfileMode); 81 80 MODECASE(CHIPTOOL_MODE_UPDATEPROCESSEDIMFILE, updateprocessedimfileMode); 81 MODECASE(CHIPTOOL_MODE_PROMOTEEXP, promoteexpMode); 82 82 MODECASE(CHIPTOOL_MODE_BLOCK, blockMode); 83 83 MODECASE(CHIPTOOL_MODE_MASKED, maskedMode); … … 495 495 } 496 496 497 #if 0 497 498 // XXX I've decided to make the transaction cover the Exp migration as 498 499 // well. Otherwise, if the last imfile in an exp is moved and the exp … … 508 509 return false; 509 510 } 511 #endif 510 512 511 513 if (!psDBCommit(config->dbh)) { … … 1074 1076 1075 1077 1076 static bool chipProcessedCompleteExp(pxConfig *config)1078 static bool promoteexpMode(pxConfig *config) 1077 1079 { 1078 1080 PS_ASSERT_PTR_NON_NULL(config, false); 1081 1082 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1083 1084 psMetadata *where = psMetadataAlloc(); 1085 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1079 1086 1080 1087 // look for completed chipPendingExp … … 1086 1093 } 1087 1094 1095 if (where && psListLength(where->list)) { 1096 psString whereClause = psDBGenerateWhereSQL(where, NULL); 1097 psStringAppend(&query, " %s", whereClause); 1098 psFree(whereClause); 1099 } 1100 psFree(where); 1101 1102 // treat limit == 0 as "no limit" 1103 if (limit) { 1104 psString limitString = psDBGenerateLimitSQL(limit); 1105 psStringAppend(&query, " %s", limitString); 1106 psFree(limitString); 1107 } 1108 1088 1109 if (!p_psDBRunQuery(config->dbh, query)) { 1089 1110 psError(PS_ERR_UNKNOWN, false, "database error"); … … 1108 1129 1109 1130 chipRunRow *chipRun = chipRunObjectFromMetadata(row); 1131 if (!psDBTransaction(config->dbh)) { 1132 psError(PS_ERR_UNKNOWN, false, "database error"); 1133 return false; 1134 } 1135 1110 1136 // set chipRun.state to 'stop' 1111 1137 if (!pxchipRunSetState(config, chipRun->chip_id, "full")) { … … 1119 1145 // NULL for end_stage means go as far as possible 1120 1146 if (chipRun->end_stage && psStrcasestr(chipRun->end_stage, "chip")) { 1147 if (!psDBCommit(config->dbh)) { 1148 psError(PS_ERR_UNKNOWN, false, "database error"); 1149 return false; 1150 } 1151 1121 1152 psFree(chipRun); 1122 1153 continue; … … 1136 1167 chipRun->end_stage 1137 1168 )) { 1138 // rollback 1139 if (!psDBRollback(config->dbh)) { 1169 if (!psDBRollback(config->dbh)) { 1140 1170 psError(PS_ERR_UNKNOWN, false, "database error"); 1141 1171 } … … 1145 1175 return false; 1146 1176 } 1177 if (!psDBCommit(config->dbh)) { 1178 psError(PS_ERR_UNKNOWN, false, "database error"); 1179 return false; 1180 } 1147 1181 psFree(chipRun); 1148 1182 }
Note:
See TracChangeset
for help on using the changeset viewer.
