Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2007_12_02.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: December  2, 2007 - December  8, 2007 Archives</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/week_2007_11_18.html" title="November 18, 2007 - November 24, 2007" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2008_01_20.html" title="January 20, 2008 - January 26, 2008" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2007_11_18.html">&laquo; November 18, 2007 - November 24, 2007</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2008_01_20.html">January 20, 2008 - January 26, 2008 &raquo;</a>
38                      </p>
39                      
40                      
41                      <!--
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44          xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <rdf:Description
46     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_12_02.html#entry-000693"
47     trackback:ping="http://defaria.com/mt/mt-tb.cgi/80"
48     dc:title=""
49     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_12_02.html#entry-000693"
50     dc:subject=""
51     dc:description=" Documented how to properly source cq_setup..."
52     dc:creator=""
53     dc:date="2007-12-06T16:52:05-06:00" />
54 </rdf:RDF>
55 -->
56
57
58                      <h2 class="date-header">December  6, 2007</h2>
59                      <a id="a000693"></a>
60                      <div class="entry" id="entry-693">
61                         <h3 class="entry-header"></h3>
62                         <div class="entry-content">
63                            <div class="entry-body">
64                               <ul>
65   <li>Documented how to properly source cq_setup</li>
66 </ul>
67                               
68                               <h3>cq_setup</h3>
69
70 <p>In order for Clearquest to work properly the user must source cq_setup.
71 Rational provides both cq_setup.csh for C style shells and cq_setup.sh
72 for Borne style shells. GD only primarly supports tcsh/csh shells and
73 provides a start up environment for those shells. However, Linux
74 systems then to use bash by default.</p>
75
76 <h3>bashrc</h3>
77
78 <p>An effort has been made to tranliterate the GD/RAN tcsh/csh startup
79 environment -&gt; a bash startup environment (this can be found under
80 /prj/muosran/config/bashrc).  Further complicating matters is that SWIT
81 and Pat Phelps group have their own, highly customized environment.</p>
82
83 <h3>Proposed change to ~/.bash_profile</h3>
84
85 <div class=code><pre>
86 if [ -f /opt/rational/clearquest/bin/clearquest ]; then
87   . /prj/muosran/config/cq_setup.sh
88   fi
89 </pre></div>
90
91 <p>The above should be added to the ~/.bash_profile which (from the bash(1) manpage):</p>
92
93 <blockquote>
94   <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>
95 </blockquote>
96
97 <p>Since we are only really concerned with executing cq_setup for the purposes or running clearquest, the GUI client, we should only be
98 concerned with interactive login shells.</p>
99
100 <p>For the record, also from the bash(1) manpage:</p>
101
102 <blockquote>
103   <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>
104 </blockquote>
105
106 <h3>The /prj/muosran/config versions</h3>
107
108 <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>
109
110 <h3>Platform independence</h3>
111
112 <p>In order to maintain platform independance the cq_setup.[csh|sh] script
113 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;
114 is one of sun5, rhat_x86 or later changed to linux_x86.</p>
115
116 <h3>What does cq_setup really do?</h3>
117
118 <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>
119
120 <h3>Dumping environment variable settings</h3>
121
122 <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>
123
124 <div class=code><pre>
125 # /opt/rational/clearquest/bin/clearquest -dumpsh
126 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>
127 export PATH;
128 CQ_HOME='/opt/rational/clearquest/';
129 export CQ_HOME;
130 CQ_ARCH='sun5';
131 export CQ_ARCH;
132 ODBCINI='/opt/rational/clearquest//sun5/resources/cqodbc.ini';
133 export ODBCINI;
134 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>
135 export LM_LICENSE_FILE;
136 RSU_TEMPLATE2_INI='/opt/rational/clearquest//sun5/resources/templates2.ini';<br>
137 export RSU_TEMPLATE2_INI;
138 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>
139 export MANPATH;
140 CQ_HELP_BROWSER='netscape';
141 export CQ_HELP_BROWSER;
142 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>
143 export CQ_PERLLIB;
144 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>
145 export LD_LIBRARY_PATH;
146 EVAL_STATUS=0;<br>
147 export EVAL_STATUS;</tt>
148 </pre></div>
149
150 <h3>Eval</h3>
151
152 <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>
153
154 <div class=code><pre>
155 if [ -f /opt/rational/clearquest/bin/clearquest ]; then
156   . /prj/muosran/config/cq_setup.sh
157 fi
158 </pre></div>
159
160                               
161                               <p class="entry-footer">
162                                  <span class="post-footers">Posted by  at  4:52 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000693.html">Permalink</a>
163                                  
164                                  | <a href="http://defaria.com/blogs/Status/archives/000693.html#trackback">TrackBacks (0)</a>
165                               </p>
166                            </div>
167                         </div>
168                      </div>
169                      
170                   </div>
171                </div>
172             </div>
173          </div>
174       </div>
175    </div>
176 </body>
177 </html>