Changeset 10882
- Timestamp:
- Jan 2, 2007, 4:58:38 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r10623 r10882 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $7 * @date $Date: 200 6-12-11 20:59:48 $6 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-01-03 02:58:38 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 456 456 pmConfigLoadRecipeOptions (config, "-Db"); 457 457 458 459 // check for values that override DB* keywords 460 argNum = psArgumentGet(*config->argc, config->argv, "-dbserver"); 461 if (argNum > 0) { 462 psArgumentRemove(argNum, config->argc, config->argv); 463 if (argNum >= *config->argc) { 464 psLogMsg("psModules.config", PS_LOG_WARN, 465 "-dbserver command-line switch provided without the required server name --- "); 466 } else { 467 char *dbserver = config->argv[argNum]; // The camera configuration file to read 468 if (!psMetadataAddStr(config->site, PS_LIST_TAIL, "DBSERVER", PS_META_REPLACE, NULL, dbserver)) { 469 psLogMsg("psModules.config", PS_LOG_WARN, 470 "failed to overwrite .ipprc DBSERVER value --- "); 471 } 472 473 psArgumentRemove(argNum, config->argc, config->argv); 474 } 475 } 476 477 argNum = psArgumentGet(*config->argc, config->argv, "-dbname"); 478 if (argNum > 0) { 479 psArgumentRemove(argNum, config->argc, config->argv); 480 if (argNum >= *config->argc) { 481 psLogMsg("psModules.config", PS_LOG_WARN, 482 "-dbname command-line switch provided without the required database name --- "); 483 } else { 484 char *dbname = config->argv[argNum]; // The camera configuration file to read 485 if (!psMetadataAddStr(config->site, PS_LIST_TAIL, "DBNAME", PS_META_REPLACE, NULL, dbname)) { 486 psLogMsg("psModules.config", PS_LOG_WARN, 487 "failed to overwrite .ipprc DBNAME value --- "); 488 } 489 490 psArgumentRemove(argNum, config->argc, config->argv); 491 } 492 } 493 494 argNum = psArgumentGet(*config->argc, config->argv, "-dbuser"); 495 if (argNum > 0) { 496 psArgumentRemove(argNum, config->argc, config->argv); 497 if (argNum >= *config->argc) { 498 psLogMsg("psModules.config", PS_LOG_WARN, 499 "-dbuser command-line switch provided without the required database name --- "); 500 } else { 501 char *dbuser = config->argv[argNum]; // The camera configuration file to read 502 if (!psMetadataAddStr(config->site, PS_LIST_TAIL, "DBUSER", PS_META_REPLACE, NULL, dbuser)) { 503 psLogMsg("psModules.config", PS_LOG_WARN, 504 "failed to overwrite .ipprc DBUSER value --- "); 505 } 506 507 psArgumentRemove(argNum, config->argc, config->argv); 508 } 509 } 510 511 argNum = psArgumentGet(*config->argc, config->argv, "-dbpassword"); 512 if (argNum > 0) { 513 psArgumentRemove(argNum, config->argc, config->argv); 514 if (argNum >= *config->argc) { 515 psLogMsg("psModules.config", PS_LOG_WARN, 516 "-dbpassword command-line switch provided without the required password --- "); 517 } else { 518 char *dbpassword = config->argv[argNum]; // The camera configuration file to read 519 if (!psMetadataAddStr(config->site, PS_LIST_TAIL, "DBPASSWORD", PS_META_REPLACE, NULL, dbpassword)) { 520 psLogMsg("psModules.config", PS_LOG_WARN, 521 "failed to overwrite .ipprc DBPASSWORD value --- "); 522 } 523 524 psArgumentRemove(argNum, config->argc, config->argv); 525 } 526 } 527 528 argNum = psArgumentGet(*config->argc, config->argv, "-dbport"); 529 if (argNum > 0) { 530 psArgumentRemove(argNum, config->argc, config->argv); 531 if (argNum >= *config->argc) { 532 psLogMsg("psModules.config", PS_LOG_WARN, 533 "-dbpport command-line switch provided without the required port number --- "); 534 } else { 535 char *dbport = config->argv[argNum]; // The camera configuration file to read 536 if (!psMetadataAddS32(config->site, PS_LIST_TAIL, "DBPORT", PS_META_REPLACE, NULL, (psS32)atoi(dbport))) { 537 psLogMsg("psModules.config", PS_LOG_WARN, 538 "failed to overwrite .ipprc DBPORT value --- "); 539 } 540 541 psArgumentRemove(argNum, config->argc, config->argv); 542 } 543 } 544 545 458 546 psErrorClear(); // we may have failed to find some items in the metadata 459 547
Note:
See TracChangeset
for help on using the changeset viewer.
