Changeset 247 for trunk/dasscm
- Timestamp:
- Oct 13, 2008, 6:04:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dasscm/dasscm
r244 r247 36 36 my $DASSCM_REPOSITORY_NAME; 37 37 my $DASSCM_SVN_REPOSITORY; 38 my $DASSCM_CHECKOUT_USERNAME; 39 my $DASSCM_CHECKOUT_PASSWORD; 40 38 41 39 42 # current directory at program start … … 201 204 if ( "$USER" eq "root" ) { 202 205 if ( ( not $DASSCM_USERNAME ) and ( $command ne "login" ) ) { 203 fatalerror( "Envirnonment variable DASSCM_USERNAME not set.", "Set DASSCM_USERNAME to your subversion user account or", "use 'dasscm login'" ;206 fatalerror( "Envirnonment variable DASSCM_USERNAME not set.", "Set DASSCM_USERNAME to your subversion user account or", "use 'dasscm login'" ); 204 207 } 205 208 $svnOptions .= " --no-auth-cache "; … … 356 359 } 357 360 358 sub svn_check_credentials( $$ ) 361 362 363 sub svn_check_credentials( $$;$$ ) 359 364 { 360 365 my $username = shift; 361 366 my $password = shift; 362 367 363 print "checking credentials ... "; 368 # check silently are allow user interaction? 369 my $interactive = shift || 0; 370 371 # default: exit program, if repository is not accessable 372 # (do not exit for 'init') 373 my $fatalerror = shift || 1; 374 375 376 377 print "checking credentials "; 364 378 365 379 if ( !$username ) { … … 370 384 fatalerror("no password given"); 371 385 } 386 387 print "for " . $username . "@" . $DASSCM_SVN_REPOSITORY . ": "; 372 388 373 389 # Options for "svn info" are not supported by subversion 1.0.0 (SLES9), … … 379 395 #print @result; 380 396 381 ( my $rc_update, my @result ) = 382 run_command( 383 "$SVN ls --non-interactive --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY" 384 ); 385 386 if ( $rc_update != 0 ) { 387 print "\n", @result; 388 fatalerror(); 389 } 390 391 } 397 my $rc_update; 398 if( $interactive ) { 399 $rc_update = run_interactive( "$SVN ls --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY" ); 400 } else { 401 ( $rc_update, my @result ) = 402 run_command( 403 "$SVN ls --non-interactive --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY" 404 ); 405 406 if ( $rc_update != 0 ) { 407 print "\n", @result; 408 if( $fatalerror ) { 409 fatalerror(); 410 } 411 return; 412 } 413 } 414 415 # return success 416 return $rc_update == 0; 417 } 418 419 392 420 393 421 sub svn_update( ;$ ) … … 504 532 $input_username = <STDIN>; 505 533 chomp($input_username); 534 535 $input_username = $input_username || $DASSCM_USERNAME; 506 536 } 507 537 508 538 # hidden password input 509 print "Enter DASSCM user password: ";539 print "Enter password for $input_username: "; 510 540 ReadMode('noecho'); 511 541 my $input_password = <STDIN>; … … 514 544 print "\n"; 515 545 516 svn_check_credentials( $input_username || $DASSCM_USERNAME, 517 $input_password ); 546 # checking checkout username/password 547 svn_check_credentials( $DASSCM_CHECKOUT_USERNAME, $DASSCM_CHECKOUT_PASSWORD ); 548 print "checkout access okay\n"; 549 550 svn_check_credentials( $input_username, $input_password ); 518 551 519 552 # … … 856 889 $config->{'DASSCM_SVN_REPOSITORY_BASE'} . "/" . $DASSCM_REPOSITORY_NAME; 857 890 858 my$DASSCM_CHECKOUT_USERNAME = $config->{'DASSCM_CHECKOUT_USERNAME'};859 my$DASSCM_CHECKOUT_PASSWORD = $config->{'DASSCM_CHECKOUT_PASSWORD'};891 $DASSCM_CHECKOUT_USERNAME = $config->{'DASSCM_CHECKOUT_USERNAME'}; 892 $DASSCM_CHECKOUT_PASSWORD = $config->{'DASSCM_CHECKOUT_PASSWORD'}; 860 893 861 894 #
Note:
See TracChangeset
for help on using the changeset viewer.