Changeset 16596 for trunk/ippTools/src/pstamptool.c
- Timestamp:
- Feb 21, 2008, 6:50:18 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pstamptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pstamptool.c
r16544 r16596 106 106 return false; 107 107 } 108 psString outProduct = psMetadataLookupStr(&status, config->args, "-out_product"); 109 if (!status) { 110 psError(PS_ERR_UNKNOWN, false, "failed to looku value for -out_product"); 111 return false; 112 } 113 if (!outProduct) { 114 psError(PS_ERR_UNKNOWN, true, "-out_product is required"); 115 return false; 116 } 108 117 109 118 psString lastFileset = psMetadataLookupStr(&status, config->args, "-last_fileset"); … … 115 124 if (!pstampDataStoreInsert(config->dbh, 116 125 0, 117 uri,126 state, 118 127 lastFileset, 119 state 128 outProduct, 129 uri 120 130 )) { 121 131 psError(PS_ERR_UNKNOWN, false, "database error"); … … 128 138 static bool datastoreMode(pxConfig *config) 129 139 { 130 PS_ASSERT_PTR_NON_NULL(config, false); 131 132 if (!p_psDBRunQuery(config->dbh, "SELECT * FROM pstampDataStore")) { 140 bool status = false; 141 PS_ASSERT_PTR_NON_NULL(config, false); 142 143 psString ds_id = psMetadataLookupStr(&status, config->args, "-ds_id"); 144 if (!status) { 145 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -ds_id"); 146 return false; 147 } 148 149 psString query = NULL; 150 psStringAppend(&query, "SELECT * FROM pstampDataStore"); 151 if (ds_id) { 152 psStringAppend(&query, " WHERE ds_id = '%s'", ds_id); 153 } 154 if (!p_psDBRunQuery(config->dbh, query)) { 133 155 psError(PS_ERR_UNKNOWN, false, "database error"); 134 156 return false; … … 194 216 195 217 if (!state && !lastFileset) { 196 psError(PS_ERR_UNKNOWN, true, " one of -last_fileset or -state is required");218 psError(PS_ERR_UNKNOWN, true, "at least one of -last_fileset or -state is required"); 197 219 return false; 198 220 } … … 247 269 return false; 248 270 } 271 psString outFileset = psMetadataLookupStr(&status, config->args, "-out_fileset"); 272 if (!status) { 273 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -out_fileset"); 274 return false; 275 } 276 if (!outFileset) { 277 psError(PS_ERR_UNKNOWN, true, "-out_fileset is required"); 278 return false; 279 } 249 280 250 281 // Data Store ID is optional … … 259 290 260 291 char *query ="INSERT INTO pstampRequest" 261 " (state, uri, ds_id)" 262 " VALUES( 'new', '%s', %s)"; 263 264 if (!p_psDBRunQuery(config->dbh, query, uri, ds_id)) { 265 psError(PS_ERR_UNKNOWN, false, "database error"); 266 psFree(query); 292 " (state, uri, ds_id, outFileset)" 293 " VALUES( 'new', '%s', %s, '%s')"; 294 295 if (!p_psDBRunQuery(config->dbh, query, uri, ds_id, outFileset)) { 296 psError(PS_ERR_UNKNOWN, false, "database error"); 267 297 return false; 268 298 }
Note:
See TracChangeset
for help on using the changeset viewer.
