- Timestamp:
- Oct 15, 2007, 11:57:43 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dasscm/dasscm
r218 r220 29 29 # file to store permissions 30 30 my $permissions_file = "/etc/permissions.d/dasscm.permission_backup"; 31 31 32 # configuration file 32 33 my $config_file = "/etc/dasscm.conf"; … … 48 49 49 50 my $verbose = 0; 50 51 51 52 52 ##################################################################### … … 72 72 print " permissions\n"; 73 73 print "\n"; 74 print "preperation:\n", 75 " if dasscm is already configured,\n", 76 " use 'dasscm login' and than eg. 'add'.\n", 77 " The environment variables\n", 78 " DASSCM_REPO\n", 79 " DASSCM_PROD\n", 80 " DASSCM_USERNAME\n", 81 " DASSCM_PASSWORD\n", 82 " are evaluated, but set automatically by 'dasscm login'.\n", 83 "\n", 84 " If dasscm is not yet configured, read", 85 " /usr/share/doc/packages/dasscm/dasscm_howto.txt\n"; 74 print "preperation:\n", " if dasscm is already configured,\n", 75 " use 'dasscm login' and than eg. 'add'.\n", 76 " The environment variables\n", " DASSCM_REPO\n", " DASSCM_PROD\n", 77 " DASSCM_USERNAME\n", " DASSCM_PASSWORD\n", 78 " are evaluated, but set automatically by 'dasscm login'.\n", "\n", 79 " If dasscm is not yet configured, read", 80 " /usr/share/doc/packages/dasscm/dasscm_howto.txt\n"; 86 81 } 87 82 … … 192 187 ); 193 188 } 194 195 196 189 197 190 sub generatePermissionList … … 283 276 my $password = shift; 284 277 278 print "checking credentials ... "; 279 280 # Options for "svn info" are not supported by subversion 1.0.0 (SLES9), 281 # therefore switching to "svn status" 282 # ( my $rc_update, my @result ) = 283 # run_command( 284 # "$SVN info --non-interactive --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY" 285 # ); 286 #print @result; 287 285 288 ( my $rc_update, my @result ) = 286 289 run_command( 287 "$SVN info--non-interactive --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY"290 "$SVN ls --non-interactive --no-auth-cache --username $username --password $password $DASSCM_SVN_REPOSITORY" 288 291 ); 289 290 print @result;291 292 292 293 if ( $rc_update != 0 ) { … … 300 301 my $update_path = shift || $DASSCM_REPO; 301 302 ( my $rc_update, my @result ) = 302 run_command("$SVN update $svnCheckoutCredentials $update_path"); 303 run_command( 304 "$SVN update --non-interactive $svnCheckoutCredentials $update_path"); 303 305 print @result; 304 306 if ( $rc_update != 0 ) { … … 309 311 sub svn_getStoredFiles( ;$ ) 310 312 { 313 311 314 # TODO: get_filenames? 312 315 #my $rel_path = shift || ""; 313 316 #my $path = "${DASSCM_REPO}/${rel_path}"; 314 317 my $path = ${DASSCM_REPO}; 318 315 319 # svn ls -R is better, but much, much slower 316 320 # ( my $rc, my @result ) = run_command("$SVN ls --recursive $svnCheckoutCredentials $path"); 317 ( my $rc, my @result ) = run_command("cd $path && find | grep -v '/.svn' | sed -e 's/\.\\///' | grep -v '^\$'"); 321 ( my $rc, my @result ) = 322 run_command( 323 "cd $path && find | grep -v '/.svn' | sed -e 's/\.\\///' | grep -v '^\$'" 324 ); 318 325 if ( $rc != 0 ) { 319 326 print @result; … … 362 369 ReadMode('normal'); 363 370 chomp($input_password); 371 print "\n"; 364 372 365 373 svn_check_credentials( $input_username, $input_password ); … … 403 411 } 404 412 405 406 413 sub update(@) 407 414 { … … 414 421 svn_update(); 415 422 } 416 417 423 418 424 sub add_helper(@) … … 449 455 } 450 456 451 452 453 457 # 454 458 # add (is used for command add and commit) … … 466 470 # add file 467 471 add_helper( $_[0] ); 472 468 473 # create new permissions file 469 474 permissions(); 475 470 476 # add permissions file 471 add_helper( $permissions_file);477 add_helper($permissions_file); 472 478 473 479 if ( $options{'message'} ) { … … 484 490 #print $dirname_repo. "\n"; 485 491 } 486 487 488 492 489 493 sub blame(@) … … 542 546 543 547 # TODO: start at subdirectories ? 544 my $dir = $DASSCM_REPO;548 my $dir = $DASSCM_REPO; 545 549 my @files = svn_getStoredFiles($dir); 546 550 … … 592 596 } 593 597 594 595 596 598 sub permissions(@) 597 599 { … … 605 607 606 608 # TODO: start at subdirectories ? 607 my $dir = $DASSCM_REPO;609 my $dir = $DASSCM_REPO; 608 610 my @files = svn_getStoredFiles($dir); 609 611 … … 614 616 my $OUTFILE; 615 617 my $tofile = 0; # Status für schreiben in File 616 618 617 619 if ( -w dirname($permissions_file) ) { 618 620 … … 624 626 print OUTFILE "#\n"; 625 627 print OUTFILE "# created by dasscm permissions\n"; 626 print OUTFILE "# It is intended to be used for restoring permissions\n"; 628 print OUTFILE 629 "# It is intended to be used for restoring permissions\n"; 627 630 } else { 628 631 … … 635 638 } 636 639 637 if ($tofile) { 640 if ($tofile) { 638 641 close(OUTFILE); 639 642 }
Note:
See TracChangeset
for help on using the changeset viewer.