2 ################################################################################
4 # File: $RCSfile: lsnusers,v $
5 # Revision: $Revision: 1.3 $
6 # Description: This script will perform builds for ILM/HP.
7 # Author: Andrew@DeFaria.com
8 # Created: Mon Feb 13 10:35:34 PST 2006
9 # Modified: $Date: 2011/08/31 21:57:06 $
12 # (c) Copyright 2006, Andrew@DeFaria.com, all rights reserved.
14 ################################################################################
19 use lib "$FindBin::Bin/../lib";
27 my $me = $FindBin::Script;
29 # Pick up from the environment if the user specifies pvob
30 my $pvob = $ENV{pvob};
32 my @pvob_related_objects = (
40 display "Usage: $me: <object_selector>";
49 Usage "Must specify an object selector" if !defined $ARGV [0];
51 my $object = $ARGV [0];
52 my $object_type = $object;
55 $object_type =~ s/:.*//;
57 if ($object =~ m/(.*)\@(.*)/) {
62 Usage "Must specify pvob or set pvob in your environment" if !$pvob;
64 if (InArray $object_type, @pvob_related_objects) {
65 # Need to add additional "\\" because Windows will eat them up when executing a ``;
66 if ($arch eq "windows" or $arch eq "cygwin") {
67 $full_object = "$object\@\\$pvob";
69 $full_object = "$object\@$pvob";
72 $full_object = $object;
74 # Handle oddity with windows using \ for vob tags
75 if ($full_object =~ /vob:\\(.*)/) {
76 $full_object = "vob:\\\\" . $1;
80 my $cmd = "cleartool lslock $full_object 2>&1";
85 if (scalar @output eq 0) {
86 display "$object is not locked";
90 display "$object does not exist";
97 if (/\"Locked except for users: (.*)\"/) {
98 @users = split " ", $1;
103 if ((scalar @users) gt 0) {
104 display "Users excluded from lock for this $object_type include:";
106 foreach (sort @users) {
110 display "This $object_type is locked from all users";