Changeset 28110
- Timestamp:
- May 26, 2010, 11:58:13 AM (16 years ago)
- Location:
- tags/ipp-20100525
- Files:
-
- 13 edited
-
dbconfig (modified) (1 prop)
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/pstamp.md (modified) (1 diff)
-
ippTools (modified) (1 prop)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff)
-
ippTools/share/pxadmin_drop_tables.sql (modified) (1 diff)
-
ippTools/src/pstamptool.c (modified) (3 diffs)
-
ippTools/src/pstamptool.h (modified) (1 diff)
-
ippTools/src/pstamptoolConfig.c (modified) (2 diffs)
-
ippTools/src/pxtools.c (modified) (14 diffs)
-
pstamp (modified) (1 prop)
-
pstamp/scripts/pstamp_insert_request.pl (modified) (1 diff)
-
pstamp/scripts/pstamp_webrequest.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20100525/dbconfig
-
Property svn:mergeinfo
set to
/branches/czw_branch/20100427/dbconfig merged eligible /branches/pap/dbconfig merged eligible /trunk/dbconfig merged eligible
-
Property svn:mergeinfo
set to
-
tags/ipp-20100525/dbconfig/changes.txt
r28096 r28110 1712 1712 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1713 1713 1714 CREATE TABLE pstampWebRequest ( 1715 num BIGINT AUTO_INCREMENT, 1716 PRIMARY KEY(num) 1717 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1718 -
tags/ipp-20100525/dbconfig/pstamp.md
r27874 r28110 59 59 fault S16 0 60 60 END 61 62 pstampWebRequest METADATA 63 num S64 0 # Primary Key AUTO_INCREMENT 64 END -
tags/ipp-20100525/ippTools
-
Property svn:mergeinfo
set to
/branches/czw_branch/20100427/ippTools merged eligible /branches/pap/ippTools merged eligible /trunk/ippTools merged eligible
-
Property svn:mergeinfo
set to
-
tags/ipp-20100525/ippTools/share/pxadmin_create_tables.sql
r28096 r28110 1401 1401 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1402 1402 1403 CREATE TABLE pstampWebRequest ( 1404 num BIGINT AUTO_INCREMENT, 1405 PRIMARY KEY(num) 1406 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1407 1403 1408 CREATE TABLE distTarget ( 1404 1409 target_id BIGINT AUTO_INCREMENT, -
tags/ipp-20100525/ippTools/share/pxadmin_drop_tables.sql
r27856 r28110 85 85 DROP TABLE IF EXISTS staticskyRun; 86 86 DROP TABLE IF EXISTS Label; 87 DROP TABLE IF EXISTS pstampWebRequest; 87 88 88 89 SET FOREIGN_KEY_CHECKS=1 -
tags/ipp-20100525/ippTools/src/pstamptool.c
r27969 r28110 53 53 static bool updatedependentMode(pxConfig *config); 54 54 static bool revertdependentMode(pxConfig *config); 55 static bool getwebrequestnumMode(pxConfig *config); 55 56 56 57 # define MODECASE(caseName, func) \ … … 95 96 MODECASE(PSTAMPTOOL_MODE_UPDATEDEPENDENT, updatedependentMode); 96 97 MODECASE(PSTAMPTOOL_MODE_REVERTDEPENDENT, revertdependentMode); 98 MODECASE(PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumMode); 97 99 default: 98 100 psAbort("invalid option (this should not happen)"); … … 1334 1336 return true; 1335 1337 } 1338 1339 static bool getwebrequestnumMode(pxConfig *config) 1340 { 1341 PS_ASSERT_PTR_NON_NULL(config, false); 1342 1343 if (!pstampWebRequestInsert(config->dbh, 0 )) { 1344 psError(PS_ERR_UNKNOWN, false, "failed to insert pstampWebRequest"); 1345 return false; 1346 } 1347 1348 psS64 req_id = psDBLastInsertID(config->dbh); 1349 1350 printf("%" PRId64 "\n", req_id); 1351 1352 return true; 1353 } -
tags/ipp-20100525/ippTools/src/pstamptool.h
r27874 r28110 48 48 PSTAMPTOOL_MODE_UPDATEDEPENDENT, 49 49 PSTAMPTOOL_MODE_REVERTDEPENDENT, 50 PSTAMPTOOL_MODE_GETWEBREQUESTNUM, 50 51 } pstamptoolMode; 51 52 -
tags/ipp-20100525/ippTools/src/pstamptoolConfig.c
r27874 r28110 235 235 psMetadataAddBool(projectArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 236 236 237 // -getwebrequestnum 238 psMetadata *getwebrequestnumArgs = psMetadataAlloc(); 239 237 240 psMetadata *argSets = psMetadataAlloc(); 238 241 psMetadata *modes = psMetadataAlloc(); … … 264 267 PXOPT_ADD_MODE("-modproject", "", PSTAMPTOOL_MODE_MODPROJECT, modprojectArgs); 265 268 PXOPT_ADD_MODE("-project", "", PSTAMPTOOL_MODE_PROJECT, projectArgs); 269 PXOPT_ADD_MODE("-getwebrequestnum","", PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumArgs); 266 270 267 271 if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) { -
tags/ipp-20100525/ippTools/src/pxtools.c
r28091 r28110 48 48 } 49 49 50 psString pxMergeCodeVersions(psString version1, psString version2) { 50 psString pxMergeCodeVersions(psString version1, psString version2) 51 { 52 if (!version1 && !version2) { 53 return NULL; 54 } 55 56 if (!version1) { 57 return psStringCopy(version2); 58 } 59 if (!version2) { 60 return psStringCopy(version1); 61 } 62 63 bool mod1 = false, mod2 = false; // Modified versions? 64 if (strchr(version1, 'M')) { 65 psStringSubstitute(&version1, "M", ""); 66 mod1 = true; 67 } 68 if (strchr(version2, 'M')) { 69 psStringSubstitute(&version2, "M", ""); 70 mod2 = true; 71 } 72 73 int num1 = strtol(version1, NULL, 10); 74 int num2 = strtol(version2, NULL, 10); 75 int numO = PS_MAX(num1, num2); 76 51 77 psString out = NULL; 52 53 bool mod1 = false; 54 bool mod2 = false; 55 56 psS32 num1; 57 psS32 num2; 58 psS32 numO; 59 60 if (!version1) { 61 psStringAppend(&out, "%s", version2); 62 return(out); 63 } 64 if (!version2) { 65 psStringAppend(&out, "%s", version1); 66 return(out); 67 } 68 69 if (strchr(version1,'M')) { 70 psStringSubstitute(&version1,"M",""); 71 mod1 = true; 72 } 73 if (strchr(version2,'M')) { 74 psStringSubstitute(&version2,"M",""); 75 mod2 = true; 76 } 77 78 num1 = strtol(version1,NULL,10); 79 num2 = strtol(version2,NULL,10); 80 81 if (num1 >= num2) { 82 numO = num1; 83 } 84 else { 85 numO = num2; 86 } 87 88 psStringAppend(&out,"%" PRId32,numO); 78 psStringAppend(&out, "%" PRId32, numO); 89 79 if (mod1 || mod2) { 90 psStringAppend(&out,"M");91 } 92 return (out);80 psStringAppend(&out, "M"); 81 } 82 return out; 93 83 } 94 84 95 85 bool pxCoalesceRunStatus(pxConfig *config, const psString dbQFile, psS64 stage_id, psString *software_ver, 96 psS64 *maskfrac_npix, psF32 *maskfrac_static, psF32 *maskfrac_dynamic, 97 psF32 *maskfrac_magic, psF32 *maskfrac_advisory) { 86 psS64 *maskfrac_npix, psF32 *maskfrac_static, psF32 *maskfrac_dynamic, 87 psF32 *maskfrac_magic, psF32 *maskfrac_advisory) 88 { 98 89 psString query = pxDataGet(dbQFile); 99 /* psString text_id = NULL; */ 100 /* psStringAppend(&text_id," %" PRId64,stage_id); */ 101 /* psStringSubstitute(&query,text_id,"@STAGE_ID@"); */ 102 /* psFree(text_id); */ 90 if (!query) { 91 psError(psErrorCodeLast(), false, "Unable to read query"); 92 return false; 93 } 103 94 if (!p_psDBRunQueryF(config->dbh, query, stage_id)) { 104 psError(PS_ERR_UNKNOWN, false, "database error");105 psFree(query);106 return(false);95 psError(psErrorCodeLast(), false, "database error"); 96 psFree(query); 97 return false; 107 98 } 108 99 psFree(query); 100 109 101 psArray *output = p_psDBFetchResult(config->dbh); 110 102 if (!output) { 111 psError(PS_ERR_UNKNOWN, false, "database error"); 112 return(false); 113 } 114 103 psError(psErrorCodeLast(), false, "database error"); 104 return false; 105 } 106 107 *maskfrac_npix = 0; 108 *maskfrac_static = 0.0; 109 *maskfrac_dynamic = 0.0; 110 *maskfrac_magic = 0.0; 111 *maskfrac_advisory = 0.0; 112 115 113 for (long i = 0; i < psArrayLength(output); i++) { 116 psMetadata *row = output->data[i]; 117 118 psS32 this_npix = psMetadataLookupS32(NULL, row, "maskfrac_npix"); 119 psF32 this_static = psMetadataLookupF32(NULL, row, "maskfrac_static"); 120 psF32 this_dynamic = psMetadataLookupF32(NULL, row, "maskfrac_dynamic"); 121 psF32 this_magic = psMetadataLookupF32(NULL, row, "maskfrac_magic"); 122 psF32 this_advisory = psMetadataLookupF32(NULL, row, "maskfrac_advisory"); 123 psString this_version = psMetadataLookupStr(NULL, row, "software_ver"); 124 125 *software_ver = pxMergeCodeVersions(*software_ver,this_version); 126 /* printf("%ld : %d %f %f %f %f <-> %ld %f %f %f %f\n",i,this_npix,this_static,this_dynamic,this_magic,this_advisory, */ 127 /* *maskfrac_npix,*maskfrac_static,*maskfrac_dynamic,*maskfrac_magic,*maskfrac_advisory); */ 128 if (this_npix > 0) { 129 *maskfrac_static = ((*maskfrac_static * *maskfrac_npix) + (this_npix * this_static)) / (this_npix + *maskfrac_npix); 130 *maskfrac_dynamic = ((*maskfrac_dynamic * *maskfrac_npix) + (this_npix * this_dynamic)) / (this_npix + *maskfrac_npix); 131 *maskfrac_magic = ((*maskfrac_magic * *maskfrac_npix) + (this_npix * this_magic)) / (this_npix + *maskfrac_npix); 132 *maskfrac_advisory = ((*maskfrac_advisory * *maskfrac_npix) + (this_npix * this_advisory)) / (this_npix + *maskfrac_npix); 133 *maskfrac_npix += this_npix; 134 } 114 psMetadata *row = output->data[i]; 115 116 psS32 this_npix = psMetadataLookupS32(NULL, row, "maskfrac_npix"); 117 psF32 this_static = psMetadataLookupF32(NULL, row, "maskfrac_static"); 118 psF32 this_dynamic = psMetadataLookupF32(NULL, row, "maskfrac_dynamic"); 119 psF32 this_magic = psMetadataLookupF32(NULL, row, "maskfrac_magic"); 120 psF32 this_advisory = psMetadataLookupF32(NULL, row, "maskfrac_advisory"); 121 122 psTrace("pxtools", 3, "Mask stats: %d %f %f %f %f\n", 123 this_npix, this_static, this_dynamic, this_magic, this_advisory); 124 125 if (this_npix == 0 || this_npix == PS_MAX_S32) { 126 continue; 127 } 128 if (!isfinite(this_static) || !isfinite(this_dynamic) || 129 !isfinite(this_magic) || !isfinite(this_advisory)) { 130 continue; 131 } 132 133 psString this_version = psMetadataLookupStr(NULL, row, "software_ver"); 134 *software_ver = pxMergeCodeVersions(*software_ver,this_version); 135 136 *maskfrac_npix += this_npix; 137 *maskfrac_static += this_npix * this_static; 138 *maskfrac_dynamic += this_npix * this_dynamic; 139 *maskfrac_magic += this_npix * this_magic; 140 *maskfrac_advisory += this_npix * this_advisory; 135 141 } 136 142 psFree(output); 137 return(true); 138 } 139 140 bool pxSetRunSoftware(pxConfig *config, const psString tableName, const psString stage_id_name, const psS64 stage_id, 141 psString software_ver) { 143 144 if (*maskfrac_npix > 0) { 145 *maskfrac_static /= *maskfrac_npix; 146 *maskfrac_dynamic /= *maskfrac_npix; 147 *maskfrac_magic /= *maskfrac_npix; 148 *maskfrac_advisory /= *maskfrac_npix; 149 } 150 151 return true; 152 } 153 154 bool pxSetRunSoftware(pxConfig *config, const psString tableName, const psString stage_id_name, 155 const psS64 stage_id, psString software_ver) 156 { 142 157 char *query = "UPDATE %s SET software_ver = '%s' WHERE %s = %" PRId64; 143 /* printf(query,tableName,software_ver,stage_id_name,stage_id); */ 144 if (!p_psDBRunQueryF(config->dbh,query,tableName,software_ver,stage_id_name,stage_id)) { 145 psError(PS_ERR_UNKNOWN, false, 146 "failed to set software version for %s %" PRId64,stage_id_name,stage_id); 147 return(false); 148 } 149 150 return(true); 151 } 152 153 bool pxSetRunMaskfrac(pxConfig *config, const psString tableName, const psString stage_id_name, const psS64 stage_id, 154 psS64 maskfrac_npix, psF32 maskfrac_static, psF32 maskfrac_dynamic, 155 psF32 maskfrac_magic, psF32 maskfrac_advisory) { 156 char *query = "UPDATE %s SET maskfrac_npix = %f, maskfrac_static = %f, maskfrac_dynamic = %f, maskfrac_magic = %f, maskfrac_advisory = %f WHERE %s = %" PRId64; 157 if (!p_psDBRunQueryF(config->dbh,query,tableName,(float) maskfrac_npix,maskfrac_static, 158 maskfrac_dynamic, maskfrac_magic,maskfrac_advisory,stage_id_name,stage_id)) { 159 psError(PS_ERR_UNKNOWN, false, 160 "failed to set maskfrac stats for %s %" PRId64,stage_id_name,stage_id); 161 return(false); 162 } 163 164 165 166 return(true); 167 } 168 169 bool pxCamSetRunMaskfrac(pxConfig *config, const psString tableName, const psString stage_id_name, const psS64 stage_id, 170 psS64 maskfrac_ref_npix, psF32 maskfrac_ref_static, psF32 maskfrac_ref_dynamic, 171 psF32 maskfrac_ref_magic, psF32 maskfrac_ref_advisory, 172 psS64 maskfrac_max_npix, psF32 maskfrac_max_static, psF32 maskfrac_max_dynamic, 173 psF32 maskfrac_max_magic, psF32 maskfrac_max_advisory) { 174 char *query = "UPDATE %s SET maskfrac_ref_npix = %f, maskfrac_ref_static = %f, maskfrac_ref_dynamic = %f, maskfrac_ref_magic = %f, maskfrac_ref_advisory = %f, maskfrac_max_npix = %f, maskfrac_max_static = %f, maskfrac_max_dynamic = %f, maskfrac_max_magic = %f, maskfrac_max_advisory = %f WHERE %s = %" PRId64; 175 if (!p_psDBRunQueryF(config->dbh,query,tableName,(float) maskfrac_ref_npix,maskfrac_ref_static, 176 maskfrac_ref_dynamic, maskfrac_ref_magic,maskfrac_ref_advisory, 177 (float) maskfrac_max_npix,maskfrac_max_static, 178 maskfrac_max_dynamic, maskfrac_max_magic,maskfrac_max_advisory, 179 stage_id_name,stage_id)) { 180 psError(PS_ERR_UNKNOWN, false, 181 "failed to set maskfrac stats for %s %" PRId64,stage_id_name,stage_id); 182 return(false); 158 if (!p_psDBRunQueryF(config->dbh, query, tableName, software_ver, stage_id_name, stage_id)) { 159 psError(psErrorCodeLast(), false, 160 "failed to set software version for %s %" PRId64, stage_id_name, stage_id); 161 return false; 162 } 163 164 return true; 165 } 166 167 bool pxSetRunMaskfrac(pxConfig *config, const psString tableName, const psString stage_id_name, 168 const psS64 stage_id, psS64 maskfrac_npix, psF32 maskfrac_static, 169 psF32 maskfrac_dynamic, psF32 maskfrac_magic, psF32 maskfrac_advisory) 170 { 171 char *query = "UPDATE %s SET maskfrac_npix = %f, maskfrac_static = %f, maskfrac_dynamic = %f, " 172 "maskfrac_magic = %f, maskfrac_advisory = %f WHERE %s = %" PRId64; 173 if (!p_psDBRunQueryF(config->dbh, query, tableName, (float)maskfrac_npix, maskfrac_static, 174 maskfrac_dynamic, maskfrac_magic, maskfrac_advisory, stage_id_name, stage_id)) { 175 psError(psErrorCodeLast(), false, 176 "failed to set maskfrac stats for %s %" PRId64,stage_id_name,stage_id); 177 return false; 178 } 179 180 181 182 return true; 183 } 184 185 bool pxCamSetRunMaskfrac(pxConfig *config, const psString tableName, 186 const psString stage_id_name, const psS64 stage_id, 187 psS64 maskfrac_ref_npix, psF32 maskfrac_ref_static, psF32 maskfrac_ref_dynamic, 188 psF32 maskfrac_ref_magic, psF32 maskfrac_ref_advisory, 189 psS64 maskfrac_max_npix, psF32 maskfrac_max_static, psF32 maskfrac_max_dynamic, 190 psF32 maskfrac_max_magic, psF32 maskfrac_max_advisory) { 191 char *query = "UPDATE %s SET maskfrac_ref_npix = %f, maskfrac_ref_static = %f, maskfrac_ref_dynamic = %f, " 192 "maskfrac_ref_magic = %f, maskfrac_ref_advisory = %f, maskfrac_max_npix = %f, maskfrac_max_static = %f, " 193 "maskfrac_max_dynamic = %f, maskfrac_max_magic = %f, maskfrac_max_advisory = %f WHERE %s = %" PRId64; 194 if (!p_psDBRunQueryF(config->dbh, query, tableName, (float)maskfrac_ref_npix, maskfrac_ref_static, 195 maskfrac_ref_dynamic, maskfrac_ref_magic, maskfrac_ref_advisory, 196 (float)maskfrac_max_npix, maskfrac_max_static, 197 maskfrac_max_dynamic, maskfrac_max_magic, maskfrac_max_advisory, 198 stage_id_name, stage_id)) { 199 psError(psErrorCodeLast(), false, 200 "failed to set maskfrac stats for %s %" PRId64,stage_id_name,stage_id); 201 return false; 183 202 } 184 185 186 187 return(true); 203 204 return true; 188 205 } 189 206 … … 222 239 psMetadataItem *item = psMetadataLookup(config->args, name); 223 240 if (!item) { 224 psError( PS_ERR_UNKNOWN, false, "failed to lookup value for %s", name);241 psError(psErrorCodeLast(), false, "failed to lookup value for %s", name); 225 242 return false; 226 243 } … … 239 256 item->comment = psStringCopy (op); 240 257 if (!psMetadataAddItem(where, item, PS_LIST_TAIL, PS_META_DUPLICATE_OK)) { 241 psError( PS_ERR_UNKNOWN, false, "failed to add item %s", field);258 psError(psErrorCodeLast(), false, "failed to add item %s", field); 242 259 psFree(where); 243 260 return false; … … 293 310 char *comma = ","; 294 311 295 # define addColumn(_tab, _val) \296 do { \297 if (_val) {\298 psStringAppend(pQuery, "%s %s.%s = '%s'", separator, _tab, #_val, _val); \299 separator = comma;\300 }\312 # define addColumn(_tab, _val) \ 313 do { \ 314 if (_val) { \ 315 psStringAppend(pQuery, "%s %s.%s = '%s'", separator, _tab, #_val, _val); \ 316 separator = comma; \ 317 } \ 301 318 } while (0) 302 319 … … 331 348 332 349 if (!p_psDBRunQueryF(config->dbh, *pQuery, joinHook)) { 333 psError( PS_ERR_UNKNOWN, false, "database error");350 psError(psErrorCodeLast(), false, "database error"); 334 351 return false; 335 352 } … … 343 360 344 361 if (!p_psDBRunQuery(config->dbh, query)) { 345 psError( PS_ERR_UNKNOWN, false, "database error");362 psError(psErrorCodeLast(), false, "database error"); 346 363 return false; 347 364 } … … 349 366 psArray *output = p_psDBFetchResult(config->dbh); 350 367 if (!output) { 351 psError( PS_ERR_UNKNOWN, false, "database error");368 psError(psErrorCodeLast(), false, "database error"); 352 369 return false; 353 370 } 354 371 if (!psArrayLength(output)) { 355 372 psFree(output); 356 psError(P S_ERR_UNKNOWN, true, "no rows in dbversion");373 psError(PXTOOLS_ERR_PROG, true, "no rows in dbversion"); 357 374 return false; 358 375 } 359 376 if (psArrayLength(output) > 1) { 360 psError(P S_ERR_UNKNOWN, true, "unexpected number of rows found in dbversion: %ld",377 psError(PXTOOLS_ERR_PROG, true, "unexpected number of rows found in dbversion: %ld", 361 378 psArrayLength(output)); 362 379 return false; … … 373 390 psArray *array = NULL; 374 391 if (!pxLookupVersion(config, &array)) { 375 psError( PS_ERR_UNKNOWN, false, "pxLookupVersion failed");392 psError(psErrorCodeLast(), false, "pxLookupVersion failed"); 376 393 return NULL; 377 394 } 378 395 psMetadata *md = array->data[0]; 379 396 if (!md) { 380 psError(P S_ERR_UNKNOWN, true, "output of pxLookupVersion is null");397 psError(PXTOOLS_ERR_PROG, true, "output of pxLookupVersion is null"); 381 398 return NULL; 382 399 } … … 394 411 psArray *array = NULL; 395 412 if (!pxLookupVersion(config, &array) || !array) { 396 psError( PS_ERR_UNKNOWN, false, "pxLookupVersion failed");413 psError(psErrorCodeLast(), false, "pxLookupVersion failed"); 397 414 return false; 398 415 } 399 416 if (!ippdbPrintMetadatas(file, array, "dbversion", true)) { 400 psError( PS_ERR_UNKNOWN, false, "failed to print array");417 psError(psErrorCodeLast(), false, "failed to print array"); 401 418 psFree(array); 402 419 return false; … … 414 431 psMetadataItem *multi_item = psMetadataLookup(input, "dbversion"); 415 432 if (!multi_item || (multi_item->type != PS_DATA_METADATA_MULTI)) { 416 psError(P S_ERR_UNKNOWN, true, "dbversion multi not found in input");433 psError(PXTOOLS_ERR_PROG, true, "dbversion multi not found in input"); 417 434 return false; 418 435 } … … 420 437 psMetadataItem *dbversion = psListGet(multi_item->data.list, 0); 421 438 if (!dbversion) { 422 psError(P S_ERR_UNKNOWN, true, "dbversion not found in input");439 psError(PXTOOLS_ERR_PROG, true, "dbversion not found in input"); 423 440 return false; 424 441 } … … 429 446 psString schema_version = pxGetDBVersion(config); 430 447 if (!schema_version) { 431 psError( PS_ERR_UNKNOWN, false, "pxGetDBVersion failed");448 psError(psErrorCodeLast(), false, "pxGetDBVersion failed"); 432 449 return false; 433 450 } … … 435 452 psString import_version = psMetadataLookupStr(NULL, md, "schema_version"); 436 453 if (import_version && strcmp(import_version, schema_version)) { 437 psError(P S_ERR_UNKNOWN, true, "input file schema_version: %s does not match data base: %s",438 import_version, schema_version);454 psError(PXTOOLS_ERR_PROG, true, "input file schema_version: %s does not match data base: %s", 455 import_version, schema_version); 439 456 return false; 440 457 } else if (!import_version) { 441 psError(P S_ERR_UNKNOWN, true, "input file schema_version is NULL");458 psError(PXTOOLS_ERR_PROG, true, "input file schema_version is NULL"); 442 459 return false; 443 460 } else { … … 445 462 } 446 463 } else { 447 psError(P S_ERR_UNKNOWN, true, "Unexpected config dump format");448 return false; 449 } 450 451 return true; 452 } 464 psError(PXTOOLS_ERR_PROG, true, "Unexpected config dump format"); 465 return false; 466 } 467 468 return true; 469 } -
tags/ipp-20100525/pstamp
-
Property svn:mergeinfo
set to
/branches/czw_branch/20100427/pstamp merged eligible /branches/pap/pstamp merged eligible /trunk/pstamp merged eligible
-
Property svn:mergeinfo
set to
-
tags/ipp-20100525/pstamp/scripts/pstamp_insert_request.pl
r27211 r28110 114 114 115 115 exit 0; 116 117 # Temporary hack 118 # webrequest number is stored in a file in the current directory 119 # 120 # get this number from the database 116 # Ask the database for the next web request number 121 117 sub get_webreq_num 122 118 { 123 my $filename = "$workdir/webreq_num.txt"; 124 if (! open IN, "+< $filename" ) { 125 my $initial_num = 1; 126 open IN, "> $filename" or die "can't open $filename"; 127 print IN "$initial_num\n" or die "failed to initialize $filename"; 128 close IN; 129 return $initial_num; 119 my $command = "$pstamptool -getwebrequestnum"; 120 $command .= " -dbname $dbname" if $dbname; 121 $command .= " -dbserver $dbserver" if $dbserver; 122 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 123 run(command => $command, verbose => $verbose); 124 unless ($success) { 125 print STDERR @$stderr_buf; 126 die("Unable to perform pstamptool -getwebrequestnum: $error_code"); 127 } 128 my $webreq_num = ${$stdout_buf}[0]; 129 chomp $webreq_num; 130 131 if (!$webreq_num) { 132 die("pstamptool -getwebreqnum returned no value"); 130 133 } 131 134 132 my $webreq_num = <IN>; 133 chomp $webreq_num; 135 # print STDERR "webreq_num $webreq_num\n"; 134 136 135 print STDERR "$webreq_num\n" if $verbose;136 137 my $next = $webreq_num + 1;138 truncate IN, 0;139 seek IN, 0, 0;140 print IN "$next\n";141 142 close IN;143 137 return $webreq_num; 144 138 } -
tags/ipp-20100525/pstamp/scripts/pstamp_webrequest.pl
r27355 r28110 23 23 24 24 my $host = hostname(); 25 my $verbose = 0;25 my $verbose = 1; 26 26 my $dbname; 27 27 my $dbserver; … … 152 152 exit 0; 153 153 154 # Temporary hack 155 # webrequest number is stored in a file in the current directory 156 # 154 # Ask the database for the next web request number 157 155 sub get_webreq_num 158 156 { 159 my $filename = "webreq_num.txt"; 160 if (! open IN, "+< $filename" ) { 161 my $initial_num = 1; 162 open IN, "> $filename" or die "can't open $filename"; 163 print IN "$initial_num\n" or die "failed to initialize $filename"; 164 close IN; 165 return $initial_num; 157 my $command = "$pstamptool -getwebrequestnum"; 158 $command .= " -dbname $dbname" if $dbname; 159 $command .= " -dbserver $dbserver" if $dbserver; 160 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 161 run(command => $command, verbose => $verbose); 162 unless ($success) { 163 print STDERR @$stderr_buf; 164 die("Unable to perform pstamptool -getwebrequestnum: $error_code"); 165 } 166 my $webreq_num = ${$stdout_buf}[0]; 167 chomp $webreq_num; 168 169 if (!$webreq_num) { 170 die("pstamptool -getwebreqnum returned no value"); 166 171 } 167 172 168 my $webreq_num = <IN>; 169 chomp $webreq_num; 173 # print STDERR "webreq_num $webreq_num\n"; 170 174 171 print STDERR "$webreq_num\n" if $verbose;172 173 my $next = $webreq_num + 1;174 truncate IN, 0;175 seek IN, 0, 0;176 print IN "$next\n";177 178 close IN;179 175 return $webreq_num; 180 176 }
Note:
See TracChangeset
for help on using the changeset viewer.
