Subversion Repositories DevTools

Rev

Rev 247 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 247 Rev 253
Line 526... Line 526...
526
    #       1) Did not work on WindowsServer based build machine ??
526
    #       1) Did not work on WindowsServer based build machine ??
527
    #       2) Deleting the view could be a problem if the user had
527
    #       2) Deleting the view could be a problem if the user had
528
    #          files open in the view.
528
    #          files open in the view.
529
    #       3) Documentation doesn't really like the use of -colocated
529
    #       3) Documentation doesn't really like the use of -colocated
530
    #
530
    #
-
 
531
    #
-
 
532
    foreach my $view_count ( 1 .. 5 )
-
 
533
    {
-
 
534
        my $cc_race_condition;
-
 
535
        my $cmd = ClearToolCmd ('mkview', '-snapshot', '-tag', $VIEWTAG, $VIEWDIR);
-
 
536
        open(CMD, "$cmd 2>&1 |") || Error( "can't run command: $!");
-
 
537
        while (<CMD>)
-
 
538
        {
-
 
539
            #
-
 
540
            #   Filter output from the user
-
 
541
            #
-
 
542
            chomp;
-
 
543
            tr~\\/~/~s;
-
 
544
            Verbose2("mkview: $_");
-
 
545
 
-
 
546
            #
-
 
547
            #   Detect Race condition
-
 
548
            #   Multiple build daemons creating views too fast for ClearCase
-
 
549
            #   ClearCase can hit a race condition and fail to create a view
-
 
550
            #
-
 
551
            $cc_race_condition = ( m~Error: Unable to create directory "[^"]+": File exists\.~);
-
 
552
        }
-
 
553
        close(CMD);
531
 
554
 
-
 
555
        #
-
 
556
        #   Race condition detected
-
 
557
        #   Back-off and try again. Will only try a limited number of times
-
 
558
        #
-
 
559
        if ( $cc_race_condition  )
-
 
560
        {
532
    ClearTool( 'mkview', '-snapshot', '-tag', $VIEWTAG, $VIEWDIR);
561
            Message ("ClearCase Race condition detected");
-
 
562
            sleep ( $view_count );
-
 
563
            next;
-
 
564
        }
-
 
565
        last;
-
 
566
    }
533
    Error ("Cannot locate the created static view")
567
    Error ("Cannot locate the created static view")
534
        unless ( -d $VIEWDIR );
568
        unless ( -d $VIEWDIR );
535
 
569
 
536
    #   In order to operate in this view (ie set the config spec, we need to
570
    #   In order to operate in this view (ie set the config spec, we need to
537
    #   be in the directory of the view
571
    #   be in the directory of the view