use Clearcase;
use OSDep;
-sub new ($) {
- my ($class, $tag) = @_;
+sub new($;$) {
+ my ($class, $tag, $region) = @_;
=pod
=cut
+ $region ||= $Clearcase::CC->region;
+
$class = bless {
- tag => $tag
+ tag => $tag,
+ region => $region,
}, $class;
$class->updateVobInfo;
return $class;
} # new
-sub tag () {
+sub tag() {
my ($self) = @_;
=pod
return $self->{tag};
} # tag
-sub gpath () {
+sub gpath() {
my ($self) = @_;
=pod
return $self->{gpath};
} # gpath
-sub shost () {
+sub shost() {
my ($self) = @_;
=pod
sub name() {
goto &tag;
} # name
-sub access () {
+
+sub access() {
my ($self) = @_;
=pod
return $self->{access};
} # access
-sub mopts () {
+sub mopts() {
my ($self) = @_;
=pod
return $self->{mopts};
} # mopts
-sub region () {
+sub region() {
my ($self) = @_;
=pod
return $self->{region};
} # region
-sub active () {
+sub active() {
my ($self) = @_;
=pod
return $self->{active};
} # active
-sub replica_uuid () {
+sub replica_uuid() {
my ($self) = @_;
=pod
return $self->{replica_uuid};
} # replica_uuid
-sub host () {
+sub host() {
my ($self) = @_;
=pod
return $self->{host};
} # host
-sub access_path () {
+sub access_path() {
my ($self) = @_;
=pod
return $self->{access_path};
} # access_path
-sub family_uuid () {
+sub family_uuid() {
my ($self) = @_;
=pod
return $self->{family_uuid};
} # family_uuid
-sub vob_registry_attributes () {
+sub vob_registry_attributes() {
my ($self) = @_;
=pod
return $self->{vob_registry_attributes};
} # vob_registry_attributes
-sub expand_space () {
+sub expand_space() {
my ($self) = @_;
my ($status, @output) = $Clearcase::CC->execute ("space -vob $self->{tag}");
return;
} # expand_space
-sub expand_description () {
+sub expand_description() {
my ($self) = @_;
- my ($status, @output) = $Clearcase::CC->execute ("describe -long vob:$self->{tag}");
+ my ($status, @output) = $Clearcase::CC->execute("describe -long vob:$self->{tag}");
for (my $i = 0; $i < @output; $i++) {
if ($output[$i] =~ /created (\S+) by (.+) \((\S+)\)/) {
return %{$self->{hyperlinks}};
} # hyperlinks
-sub countdb () {
+sub countdb() {
my ($self) = @_;
# Set values to zero in case we cannot get the right values from countdb
chomp $cwd;
chdir "$self->{gpath}/db";
- my $cmd = "$Clearcase::COUNTDB vob_db 2>&1";
- my @output = `$cmd`;
+ my $cmd = "$Clearcase::COUNTDB vob_db 2>&1";
+ my @output = `$cmd`;
- if ($? != 0) {
- chdir $cwd;
- return;
- } # if
+ if ($? != 0) {
+ chdir $cwd;
+ return;
+ } # if
chomp @output;
return;
} # countdb
-sub elements () {
+sub elements() {
my ($self) = @_;
=pod
return $self->{elements};
} # elements
-sub branches () {
+sub branches() {
my ($self) = @_;
=pod
return $self->{branches};
} # branches
-sub versions () {
+sub versions() {
my ($self) = @_;
=pod
return $self->{versions};
} # versions
-sub dbsize () {
+sub dbsize() {
my ($self) = @_;
=pod
return $self->{dbsize};
} # dbsize
-sub admsize () {
+sub admsize() {
my ($self) = @_;
=pod
return $self->{admsize};
} # admsize
-sub ctsize () {
+sub ctsize() {
my ($self) = @_;
=pod
return $self->{ctsize};
} # ctsize
-sub dosize () {
+sub dosize() {
my ($self) = @_;
=pod
return $self->{dosize};
} # dosize
-sub srcsize () {
+sub srcsize() {
my ($self) = @_;
=pod
return $self->{srcsize};
} # srcsize
-sub size () {
+sub size() {
my ($self) = @_;
=pod
return $self->{size};
} # size
-sub mount () {
+sub mount() {
my ($self) = @_;
=pod
return 0 if $self->{active} && $self->{active} eq "YES";
- my ($status, @output) = $Clearcase::CC->execute ("mount $self->{tag}");
+ my ($status, @output) = $Clearcase::CC->execute("mount $self->{tag}");
return ($status, @output);
} # mount
-sub umount () {
+sub umount() {
my ($self) = @_;
=pod
=cut
- my ($status, @output) = $Clearcase::CC->execute ("umount $self->{tag}");
+ my ($status, @output) = $Clearcase::CC->execute("umount $self->{tag}");
return ($status, @output);
} # umount
-sub exists () {
+sub exists() {
my ($self) = @_;
=pod
=cut
- my ($status, @output) = $Clearcase::CC->execute ("lsvob $self->{tag}");
+ my ($status, @output) = $Clearcase::CC->execute("lsvob -region $self->{region} $self->{tag}");
return !$status;
} # exists
-sub create (;$$$%) {
+sub create(;$$$%) {
my ($self, $host, $vbs, $comment, %opts) = @_;
=pod
if ($host && $vbs) {
$additionalOpts .= '-ucmproject' if $self->{ucmproject};
- ($status, @output) = $Clearcase::CC->execute (
+ ($status, @output) = $Clearcase::CC->execute(
"mkvob -tag $self->{tag} $comment $additionalOpts -host $host -hpath $vbs "
. "-gpath $vbs $vbs");
} else {
# Note this requires that -stgloc's work and that using -auto is not a
# problem.
($status, @output) =
- $Clearcase::CC->execute ("mkvob -tag $self->{tag} $comment $additionalOpts -stgloc -auto");
+ $Clearcase::CC->execute("mkvob -tag $self->{tag} $comment $additionalOpts -stgloc -auto");
} # if
$self->updateVobInfo;
return ($status, @output);
} # create
-sub remove () {
+sub remove() {
my ($self) = @_;
=pod
=cut
- return $Clearcase::CC->execute ("rmvob -force $self->{gpath}");
+ return $Clearcase::CC->execute("rmvob -force $self->{gpath}");
} # remove
sub updateVobInfo ($$) {
my ($self) = @_;
- my ($status, @output) = $Clearcase::CC->execute ("lsvob -long $self->{tag}");
+ my ($status, @output) = $Clearcase::CC->execute("lsvob -long $self->{tag}");
# Assuming this vob is an empty shell of an object that the user may possibly
# use the create method on, return our blessings...