1 ################################################################################
5 # Description: When new elements are created in the VOB change the elements
6 # ownership to the owner of the VOB and change element permissions
7 # to appropiate for element_type.
9 # NOTE: If a particular file_type is not implemented in
10 # your VOB then comment it out. Unspecified file_types
11 # will have origional permissions, but will have
13 # Assumptions: Clearprompt is in the users PATH
14 # Author: Andrew@DeFaria.com
15 # Created: April 20, 2003
16 # Modified: 2007/05/17 07:45:48
19 ################################################################################
23 # What do we set the owner and group to?
25 my $group = "ccadmin";
28 my $pname = $ENV {CLEARCASE_PN};
30 # Let's get the real owner from the real output of describe
31 my @output = `cleartool describe vob:$pname`;
34 if (/owner\s*\w*\\(.*)/) {
36 chop $owner if $owner =~ /\r/; # any carriage return
41 # Let's get the real group from the real output of describe
43 if (/group\s*\w*\\(.*)/) {
45 chop $group if $group =~ /\r/; # any carriage return
50 # Get what element type we are dealing with
51 my $eltype = $ENV {CLEARCASE_ELTYPE};
53 if (($eltype eq "directory") ||
54 ($eltype =~ /.*script/) ||
55 ($eltype =~ /.*program/)) {
56 # All element types that are known to be 775 should be placed here.
57 `cleartool protect -chmod 775 -chown $owner -chgrp $group $pname`;
58 } elsif (($eltype eq "makefile") ||
59 ($eltype =~ /.*include/) ||
60 ($eltype =~ /.*source/)) {
61 # All element types that are known to be 664 should be placed here.
62 `cleartool protect -chmod 664 -chown $owner -chgrp $group $pname`;
63 } elsif ($eltype eq "report") {
64 # All element types that are known to be 644 should be placed here.
65 `cleartool protect -chmod 644 -chown $owner -chgrp $group $pname`;
67 # All other element types should just have the ownership changed.
68 `cleartool protect -chown $owner -chgrp $group $pname`;