Subject: | fail to extract vob name from dstbase if dstbase contains nothing but mountpoint and vob-name |
Hi,
Running ActiveState Perl v5.8.4 on Windows XP
using ClearCase-SyncTree-0.38.
Dynamic view on 'v:', mounting a vob 'myvob'.
Sample code:
my $cc = new ClearCase::SyncTree;
$cc->dstbase('v:/myvob'); # will fail in analyze() call.
$cc->dstbase('v:/myvob/mydir'); # works fine
[...]
$cc->analyze();
In the failure case, analyze reports:
"Error: must specify dest vob before analyzing at C:/Perl/site/lib/ClearCase/SyncTree.pm line 513."
Diving into SyncTree.pm, line 293:
my $dirpart = (File::Spec->splitpath($dbase))[1];
splitpath assumes the last piece of $dbase to be a filename.
In the failure case, this results in a $dirpart set to '/', where this
realy should be '/myvob'. When using a deeper $dbase path, splitpath will still make a wrong assumption, but that is masked as we only need the first dir from the path.
Suggested sollution. Tell splitpath we are dealing with a directory.
This is always correct, as "$dbase = getcwd;" (line 271).
The following change seems to fix the problem for me:
my $dirpart = (File::Spec->splitpath($dbase, 1))[1];
Other than that, great functionality! SyncTree saved me from a lot of ClearCase intefacing!
Thanks,
Hans.