Changeset 11986
- Timestamp:
- Feb 21, 2007, 4:25:52 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
stacktool.c (modified) (4 diffs)
-
stacktoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r11985 r11986 124 124 } 125 125 126 // we have to support multipe exp_tags 127 psMetadataItem *p4_ids = psMetadataLookup(config->args, "-p4_id"); 128 if (!p4_ids) { 129 // this shouldn't actually happen when using psArgs 130 psError(PS_ERR_UNKNOWN, true, "-p4_id is required"); 131 return false; 132 } 133 126 134 psTime *registered = NULL; 127 135 { … … 141 149 p6RunRow *run = p6RunRowAlloc( 142 150 0, // ID 143 "r eg", // state151 "run", // state 144 152 workdir, 145 153 NULL, // dvodb … … 153 161 return true; 154 162 } 163 164 if (!psDBTransaction(config->dbh)) { 165 psError(PS_ERR_UNKNOWN, false, "database error"); 166 return false; 167 } 168 155 169 if (!p6RunInsertObject(config->dbh, run)) { 170 if (!psDBRollback(config->dbh)) { 171 psError(PS_ERR_UNKNOWN, false, "database error"); 172 } 156 173 psError(PS_ERR_UNKNOWN, false, "database error"); 157 174 psFree(run); … … 161 178 // get the assigned p4_id 162 179 run->p6_id = psDBLastInsertID(config->dbh); 180 181 // insert the p6InputSkyfile rows 182 psListIterator *iter = psListIteratorAlloc(p4_ids->data.list, 0, false); 183 psMetadataItem *item = NULL; 184 while ((item = psListGetAndIncrement(iter))) { 185 if (!p6InputSkyfileInsert(config->dbh, run->p6_id, atoi((char *)item->data.V))) { 186 if (!psDBRollback(config->dbh)) { 187 psError(PS_ERR_UNKNOWN, false, "database error"); 188 } 189 psError(PS_ERR_UNKNOWN, false, "failed to insert p6InputSkyfile rows"); 190 return false; 191 } 192 } 193 psFree(iter); 194 195 // point of no return 196 if (!psDBCommit(config->dbh)) { 197 psError(PS_ERR_UNKNOWN, false, "database error"); 198 return false; 199 } 163 200 164 201 bool simple = false; -
trunk/ippTools/src/stacktoolConfig.c
r11985 r11986 56 56 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-tess_id", 0, 57 57 "define tessellation ID (required)", NULL); 58 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-p4_id", 59 PS_META_DUPLICATE_OK, 60 "include this p4 ID (multiple OK, required)", NULL); 61 58 62 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-simple", 0, 59 63 "use the simple output format", false);
Note:
See TracChangeset
for help on using the changeset viewer.
