in reply to Changing directory to a clearcase vob doesnot work please help

More specifically (from what Fletch said), you could this:

system("cd /$view_tag/lib_engine/hwt ; cleartool lsco -cview -r -s > + /$view_tag/lib_engine/hwt/co_file"); system("cd /$view_tag/app_hwt/$md_dir ; cleartool lsco -cview -r -s > +> /$view_tag/lib_engine/hwt/co_file");
  • Comment on Re: Changing directory to a clearcase vob doesnot work please help
  • Download Code

Replies are listed 'Best First'.
Re^2: Changing directory to a clearcase vob doesnot work please help
by sas429s (Novice) on Jan 28, 2008 at 21:24 UTC
    Based on the response I got I just tried some thing like this:
    #!/usr/bin/perl use strict; use warnings; use Cwd; my $view_tag = $ENV{'VIEW_TAG'}; my $md_dir=''; system("cd /$view_tag/lib_engine/hwt ; cleartool lsco -cview -r -s > +/$view_tag/lib_engine/hwt/co_file"); system("cd /$view_tag/app_hwt/$md_dir ; cleartool lsco -cview -r -s > +> /$view_tag/lib_engine/hwt/co_file");
    But still it complains the file name directory name volume label syntax is incorrect Thanks
      Fletch is on the right track with this. First, everything you do with clearcase inside some view tag has to be 'exec'd out'.
      So here is one complex way of getting around clearcase problem:
      Have perl generate a simple 3 liner sh script, something like,
      #!/bin/sh /pathtocleartool/cleartool setcs -tag VIEWNAME CONFIGSPECPATH ...do things here...

      Then, in your perl script, /cleartoolpath/cleartool setview -exec $shellscriptname VIEWNAME

      This spawns a new process for each thing you do using clearcase exec, which is the documentation you need to look through.
        Hi, Actually I need to completely do it from the windows side. If I understood you right I can't do it using the method suggested.correct me If I am wrong? Thanks

      I often find it helpful to print the string out, debug-style, and try executing it manually. Sometimes, just seeing it, the problem pops right out. E.g.

      my $cmd = "cd /$view_tag/lib_engine/hwt ; cleartool lsco -cview -r -s + > /$view_tag/lib_engine/hwt/co_file"; warn "cmd:\n$cmd\n"; # what exactly are we going to try to execute? system $cmd;
      my $view_tag = $ENV{'VIEW_TAG'}; system("cd /$view_tag/lib_engine/hwt ;

      What's your viewroot?
      If you're using view extended pathnames then your views will be visible under (typically) /view/$VIEW_TAG rather than /$VIEW_TAG

        Yes. That was the problem. I was using /$view_tag instead of $view_tag. Thanks a lot guys..I got it to work