Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000693.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: </title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000692.html" title="UCMWB 1.2.4 &amp; new comptree (IPC)" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000694.html" title="East.pm" />
17
18    <!--
19 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
20          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
21          xmlns:dc="http://purl.org/dc/elements/1.1/">
22 <rdf:Description
23     rdf:about="http://defaria.com/blogs/Status/archives/000693.html"
24     trackback:ping="http://defaria.com/mt/mt-tb.cgi/80"
25     dc:title=""
26     dc:identifier="http://defaria.com/blogs/Status/archives/000693.html"
27     dc:subject=""
28     dc:description=" Documented how to properly source cq_setup..."
29     dc:creator=""
30     dc:date="2007-12-06T16:52:05-06:00" />
31 </rdf:RDF>
32 -->
33
34
35    
36
37    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
38 </head>
39 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
40    <div id="container">
41       <div id="container-inner" class="pkg">
42
43          <div id="banner">
44             <div id="banner-inner" class="pkg">
45                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
46                <h2 id="banner-description">Searchable status reports and work log</h2>
47             </div>
48          </div>
49
50          <div id="pagebody">
51             <div id="pagebody-inner" class="pkg">
52                <div id="alpha">
53                   <div id="alpha-inner" class="pkg">
54
55                      <p class="content-nav">
56                         <a href="http://defaria.com/blogs/Status/archives/000692.html">&laquo; UCMWB 1.2.4 & new comptree (IPC)</a> |
57                         <a href="http://defaria.com/blogs/Status/">Main</a>
58                         | <a href="http://defaria.com/blogs/Status/archives/000694.html">East.pm &raquo;</a>
59                      </p>
60
61                      <a id="a000693"></a>
62                      <div class="entry" id="entry-693">
63                         <h3 class="entry-header"></h3>
64                         <div class="entry-content">
65                            <div class="entry-body">
66                               <ul>
67   <li>Documented how to properly source cq_setup</li>
68 </ul>
69                            </div>
70                            <div id="more" class="entry-more">
71                               <h3>cq_setup</h3>
72
73 <p>In order for Clearquest to work properly the user must source cq_setup.
74 Rational provides both cq_setup.csh for C style shells and cq_setup.sh
75 for Borne style shells. GD only primarly supports tcsh/csh shells and
76 provides a start up environment for those shells. However, Linux
77 systems then to use bash by default.</p>
78
79 <h3>bashrc</h3>
80
81 <p>An effort has been made to tranliterate the GD/RAN tcsh/csh startup
82 environment -&gt; a bash startup environment (this can be found under
83 /prj/muosran/config/bashrc).  Further complicating matters is that SWIT
84 and Pat Phelps group have their own, highly customized environment.</p>
85
86 <h3>Proposed change to ~/.bash_profile</h3>
87
88 <div class=code><pre>
89 if [ -f /opt/rational/clearquest/bin/clearquest ]; then
90   . /prj/muosran/config/cq_setup.sh
91   fi
92 </pre></div>
93
94 <p>The above should be added to the ~/.bash_profile which (from the bash(1) manpage):</p>
95
96 <blockquote>
97   <p>When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file  exists.  After  reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,  in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.</p>
98 </blockquote>
99
100 <p>Since we are only really concerned with executing cq_setup for the purposes or running clearquest, the GUI client, we should only be
101 concerned with interactive login shells.</p>
102
103 <p>For the record, also from the bash(1) manpage:</p>
104
105 <blockquote>
106   <p>When an interactive shell that is not  a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc.</p>
107 </blockquote>
108
109 <h3>The /prj/muosran/config versions</h3>
110
111 <p>As I said Rational supports it's own versions of cq_setup.[csh|sh] stored in /opt/rational/clearquest. Why the private copies under /prj/muosran/config you ask? The main (i.e. only real) difference is that the Rational copies annoyingly echo out "You can now run 'clearquest' to start Rational ClearQuest'.</p>
112
113 <h3>Platform independence</h3>
114
115 <p>In order to maintain platform independance the cq_setup.[csh|sh] script
116 resides in /opt/rational/clearquest/bin/clearquest. The Rational installation procedure symlinks this to /opt/rational/clearquest/&lt;arch&gt;/bin/clearquest where &lt;arch&gt;
117 is one of sun5, rhat_x86 or later changed to linux_x86.</p>
118
119 <h3>What does cq_setup really do?</h3>
120
121 <p>So what does this cq_setup really do? Glad you asked. Essentially it runs a shell script called clearquest. This shell script does many things related to setting up the proper environment for Clearquest execution then exec's clearquest_main. In fact, many scripts under /opt/rational/clearquest/&lt;arch&gt;/bin are merely symlinks to this clearquest script. Based on the name of the script invoked (i.e. $0) the script will do different things but all essentially set up the environment and exec clearcase_main.</p>
122
123 <h3>Dumping environment variable settings</h3>
124
125 <p>It also supports parameters. In particular it supports the special -dumpsh and -dumpcsh parameters. When called with these parameters it essentially dumps out the required shell syntax (sh or csh) for setting environment variables. Here's an example run:</p>
126
127 <div class=code><pre>
128 # /opt/rational/clearquest/bin/clearquest -dumpsh
129 PATH='/opt/rational/clearquest//bin:/home/p6258c/bin/sun:.:/home/p6258c/bin:/home/p6258c/adm/bin:/home/p6258c/adm/cc:/home/p6258c/adm/cq:/home/p6258c/adm/cvsbin:/usr/local/bin:/usr/local/oracle/product/9.2/bin:/prj/muosran/bin:/prj/software/framemaker/bin:/prj/Studio11/SUNWspro/bin:/opt/rational/clearquest/bin:/prj/muosran/bin:/opt/rational/clearcase/bin:/opt/rational/clearcase/etc:/prj/Imagix4D/bin:/usr/local/python-1.5.2/bin:/prj/MathWorksR14sp3/bin:/usr/local/swig/bin:/prj/synplify81/fpga_81/bin:/usr/local/slickedit11/bin:/usr/local/python-1.5.2/bin:/cleartrig/ent/SNSD/muos/ccadm_tools/vobs/ranccadm/scripts/clearcase:/cleartrig/ent/SNSD/muos/ccadm_tools/vobs/ranccadm/scripts/clearquest:/home/p6258c/adm/bin:/bin:/usr/local/bin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb';<br>
130 export PATH;
131 CQ_HOME='/opt/rational/clearquest/';
132 export CQ_HOME;
133 CQ_ARCH='sun5';
134 export CQ_ARCH;
135 ODBCINI='/opt/rational/clearquest//sun5/resources/cqodbc.ini';
136 export ODBCINI;
137 LM_LICENSE_FILE='flex2:flex2:1850@flex2:15280@ranadm2:19353@ranadm2:19355@ranadm2:2468@ranadm2:1717@flex2:1711@bartlett:1711@flex3:27000@ranadm2:28000@ranadm2:5270@flex2';<br>
138 export LM_LICENSE_FILE;
139 RSU_TEMPLATE2_INI='/opt/rational/clearquest//sun5/resources/templates2.ini';<br>
140 export RSU_TEMPLATE2_INI;
141 MANPATH='/opt/rational/clearquest//doc/En_US/man:/usr/man:/usr/share/man:/usr/dt/man:/usr/openwin/share/man:/usr/local/man:/usr/local/share/man';<br>
142 export MANPATH;
143 CQ_HELP_BROWSER='netscape';
144 export CQ_HELP_BROWSER;
145 CQ_PERLLIB='/opt/rational/clearquest//../common/lib/perl5/5.6.1/sun4-solaris-multi:/opt/rational/clearquest//../common/lib/perl5/5.6.1:/opt/rational/clearquest//../common/lib/perl5/site_perl/5.6.1/sun4-solaris-multi:/opt/rational/clearquest//../common/lib/perl5/site_perl/5.6.1:/opt/rational/clearquest//../common/lib/perl5/site_perl';<br>
146 export CQ_PERLLIB;
147 LD_LIBRARY_PATH='/usr/lib:/usr/ucblib:/usr/local/lib:/usr/local/oracle/product/9.2/lib:/usr/local/python-1.5.2/lib:/opt/rational/clearcase/shlib:/opt/rational/clearquest//sun5/shlib:/opt/rational/clearquest//sun5/odbc/lib';<br>
148 export LD_LIBRARY_PATH;
149 EVAL_STATUS=0;<br>
150 export EVAL_STATUS;</tt>
151 </pre></div>
152
153 <h3>Eval</h3>
154
155 <p>As such this execution is meant to passed to eval(1) so that these environment variable setting statement are evaluated and the environment is modified. Finally one should source (csh or "." in sh) this to effect the current shell. Hence we boil all this down to:</p>
156
157 <div class=code><pre>
158 if [ -f /opt/rational/clearquest/bin/clearquest ]; then
159   . /prj/muosran/config/cq_setup.sh
160 fi
161 </pre></div>
162
163                            </div>
164                         </div>
165                         <p class="entry-footer">
166                            <span class="post-footers">Posted by  on December  6, 2007  4:52 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000693.html">Permalink</a>
167                         </p>
168                      </div>
169
170                      
171                      <div class="trackbacks">
172                         <h3 id="trackback" class="trackbacks-header">TrackBack</h3>
173                         <div id="trackbacks-info">
174                            <p>TrackBack URL for this entry:<br />http://defaria.com/mt/mt-tb.cgi/80</p>
175                         </div>
176                         <div class="trackbacks-content">
177                            
178                         </div>
179                      </div>
180                      
181
182                      
183                   </div>
184                </div>
185             </div>
186          </div>
187       </div>
188    </div>
189 </body>
190 </html>