ClearCase-SyncTree

 view release on metacpan or  search on metacpan

SyncTree.pm  view on Meta::CPAN

    # Fix the protections of the target files if requested. Unix files
    # get careful consideration of bitmasks etc; Windows files just get
    # promoted to a+x if their extension looks executable.
    if ($self->protect) {
	if (MSWIN) {
	    my @exes;
	    for (keys %{$self->{ST_ADD}}) {
		next unless m%\.(bat|cmd|exe|dll|com|cgi|.?sh|pl)$%i;
		push(@exes, $self->{ST_ADD}->{$_}->{dst});
	    }
	    $ct->argv('protect', [qw(-chmod a+x)], @exes)->system if @exes;
	} else {
	    my %perms;
	    for (keys %{$self->{ST_ADD}}) {
		my $src = $self->{ST_ADD}->{$_}->{src};
		my $dst = $self->{ST_ADD}->{$_}->{dst};
		my $src_mode = (stat $src)[2];
		my $dst_mode = (stat $dst)[2];
		# 07551 represents the only bits that matter to clearcase
		if (($src_mode & 07551) ne ($dst_mode & 07551) &&
			$src !~ m%\.(?:p|html?|gif|mak|rc|ini|java|

SyncTree.pm  view on Meta::CPAN

		my $dst_mode = (stat $dst)[2];
		# 07551 represents the only bits that matter to clearcase
		if (($src_mode & 07551) ne ($dst_mode & 07551) &&
			$src !~ m%\.(?:p|html?|gif|mak|rc|ini|java|
				    c|cpp|cxx|h|bmp|ico)$|akefile%x) {
		    my $sym = sprintf("%o", ($src_mode & 07775) | 0444);
		    push(@${$perms{$sym}}, $dst);
		}
	    }
	    for (keys %perms) {
		$ct->argv('protect', ['-chmod', $_], @${$perms{$_}})->system;
	    }
	}
    }
}

sub cleanup {
    my $self = shift;
    my $mbase = $self->_mkbase;
    my $dad = dirname($mbase);
    my $ct = $self->clone_ct({autofail=>0});

synctree  view on Meta::CPAN

   -ci			Check in changes (default is to leave co'ed)
   -cr			Check in so as to preserve CR's (slower)
   -vp			Ignore versioned elements in src area
   -ctime		Checked in files get current time (no -ptime)
   -rmname		Remove files from dest area that aren't in src
   -label <lbtype>	Apply the specified label recursively to -dbase
   -lbmods		Apply the -label lbtype only to modified elems
   -c <comment>		Use specified comment for checkins
   -no			Exit after showing a preview
   -yes			Perform all work (except checkin) without prompting
   -nprotect		Turn off "cleartool protect -chmod" phase
   -rellinks            Turn absolute symlinks within sbase into relative ones
   -reuse		Attempt to reuse existing elements of same name
   -summary 		Print a summary of cleartool activities when done
   -verbose <n>		Set to 0 for least verbosity, 2 for most (default=1)
   -Narrow [!]<re>	Limit files found to those which match /re/
   -Version		Print the current $prog version and quit
   -vreuse		Attempt to reuse existing versions of same element
   -/dbg=1		Verbose mode: show cleartool cmds as they run
Notes:
    All flags may be abbreviated to their shortest unique name.



( run in 0.306 second using v1.01-cache-2.11-cpan-496ff517765 )