Changeset 220


Ignore:
Timestamp:
Oct 15, 2007, 11:57:43 AM (17 years ago)
Author:
joergs
Message:

workarounds for Subverison 1.0.0 (SLES9)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dasscm/dasscm

    r218 r220  
    2929# file to store permissions
    3030my $permissions_file = "/etc/permissions.d/dasscm.permission_backup";
     31
    3132# configuration file
    3233my $config_file = "/etc/dasscm.conf";
     
    4849
    4950my $verbose = 0;
    50 
    5151
    5252#####################################################################
     
    7272    print "   permissions\n";
    7373    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";
    8681}
    8782
     
    192187    );
    193188}
    194 
    195 
    196189
    197190sub generatePermissionList
     
    283276    my $password = shift;
    284277
     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
    285288    ( my $rc_update, my @result ) =
    286289      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"
    288291      );
    289 
    290     print @result;
    291292
    292293    if ( $rc_update != 0 ) {
     
    300301    my $update_path = shift || $DASSCM_REPO;
    301302    ( my $rc_update, my @result ) =
    302       run_command("$SVN update $svnCheckoutCredentials $update_path");
     303      run_command(
     304        "$SVN update --non-interactive $svnCheckoutCredentials $update_path");
    303305    print @result;
    304306    if ( $rc_update != 0 ) {
     
    309311sub svn_getStoredFiles( ;$ )
    310312{
     313
    311314    # TODO: get_filenames?
    312315    #my $rel_path = shift || "";
    313316    #my $path = "${DASSCM_REPO}/${rel_path}";
    314317    my $path = ${DASSCM_REPO};
     318
    315319    # svn ls -R is better, but much, much slower
    316320    # ( 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      );
    318325    if ( $rc != 0 ) {
    319326        print @result;
     
    362369    ReadMode('normal');
    363370    chomp($input_password);
     371    print "\n";
    364372
    365373    svn_check_credentials( $input_username, $input_password );
     
    403411}
    404412
    405 
    406413sub update(@)
    407414{
     
    414421    svn_update();
    415422}
    416 
    417423
    418424sub add_helper(@)
     
    449455}
    450456
    451 
    452 
    453457#
    454458# add (is used for command add and commit)
     
    466470    # add file
    467471    add_helper( $_[0] );
     472
    468473    # create new permissions file
    469474    permissions();
     475
    470476    # add permissions file
    471     add_helper( $permissions_file );
     477    add_helper($permissions_file);
    472478
    473479    if ( $options{'message'} ) {
     
    484490    #print $dirname_repo. "\n";
    485491}
    486 
    487 
    488492
    489493sub blame(@)
     
    542546
    543547    # TODO: start at subdirectories ?
    544     my $dir = $DASSCM_REPO;
     548    my $dir   = $DASSCM_REPO;
    545549    my @files = svn_getStoredFiles($dir);
    546550
     
    592596}
    593597
    594 
    595 
    596598sub permissions(@)
    597599{
     
    605607
    606608    # TODO: start at subdirectories ?
    607     my $dir = $DASSCM_REPO;
     609    my $dir   = $DASSCM_REPO;
    608610    my @files = svn_getStoredFiles($dir);
    609611
     
    614616        my $OUTFILE;
    615617        my $tofile = 0;    # Status für schreiben in File
    616        
     618
    617619        if ( -w dirname($permissions_file) ) {
    618620
     
    624626            print OUTFILE "#\n";
    625627            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";
    627630        } else {
    628631
     
    635638        }
    636639
    637         if ($tofile) { 
     640        if ($tofile) {
    638641            close(OUTFILE);
    639642        }
Note: See TracChangeset for help on using the changeset viewer.