Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_12_04.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  4, 2005 - December 10, 2005 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_2005_11_27.html" title="November 27, 2005 - December  3, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_12_11.html" title="December 11, 2005 - December 17, 2005" />
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_2005_11_27.html">&laquo; November 27, 2005 - December  3, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_12_11.html">December 11, 2005 - December 17, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">December  9, 2005</h2>
44                      <a id="a000494"></a>
45                      <div class="entry" id="entry-494">
46                         <h3 class="entry-header">Stripmime/IMS.pm</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Changed stripmime to perform logging if -v is present. Also debugged stripmime to the point where it seems to be properly being passed off the queue-pr</li>
51
52   <li>Implemented IMS.pm - a more Perl-like interface to IMS. Also started implementing cvs_ims to be a connector between CVS <-> IMS</li>
53 </ul>
54                               
55                               <p class="entry-footer">
56                                  <span class="post-footers">Posted by  at  4:43 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000494.html">Permalink</a>
57                                  
58                                  
59                               </p>
60                            </div>
61                         </div>
62                      </div>
63                      
64                      
65
66                      <h2 class="date-header">December  8, 2005</h2>
67                      <a id="a000493"></a>
68                      <div class="entry" id="entry-493">
69                         <h3 class="entry-header">Bin Merge updates/GNATS: Another word for "bug"! :-(</h3>
70                         <div class="entry-content">
71                            <div class="entry-body">
72                               <ul>
73   <li>Worked with David Dinh on getting Clearquest Windows Client on Citrix</li>
74
75   <lI>Updated BinMerge to always draw the merge arrow to the branch we are merging to</li>
76
77   <li>Fixed BinMerge's PerlTk portion to top the window iniitially</lI>
78
79   <li>Worked with Ravi on Stripmime and GNATS</li>
80 </ul>
81                               
82                               <h2>BinMerge updates</h2>
83
84 <p>Updated BinMerge to always draw the merge arrow to the branch we are merging to. There was also a bug about the choice returned from the PerlTk portion where it needed to not only be chomped but chopped until there were no more "\n"'s there. Don't know why that happened.</p>
85
86 <p>Additionally the PerlTk window would often not pop to the top of the window stack. This is apparenty common under Windows. I implemented the following code:</p>
87
88 <div class="code"><pre>
89     # Make sure the window pops to the top
90     # Trying really hard... :-)
91     $main->update;
92     $main->deiconify;
93     $main->update;
94     $main->raise;
95     $main->update;
96     $main->focusForce;
97     $main->update;
98
99     MainLoop;
100 </pre></div>
101
102 <p>At least this heavy handed approach seems to work.</p>
103
104 <h2>Stripmime and GNATS</h2>
105
106 <p>Ravi and I worked on the stripmimed thing a little today. Here's what
107 happened:</p>
108
109 <ul>
110   <li>We verified that stripmimed is indeed running. The alias was changed to not run Perl first rather to  use the shebang line. That was working - IOW /tools/gnats/4.0/bin/stripmimed would run. (later it broke).</li>
111
112   <li>We verified that stripmimed was writing properly to stdout.</li>
113
114   <li>We saw that /tools/gnats/4.0/SunOS/libexec/gnats/queue-pr was being run and a file was being deposited into /tools/gnats/db-test-it/gnats-queue.</li>
115
116   <li>We saw that /tools/gnats/4.0/SunOS/libexec/gnats/queue-pr would be run by cron (or by hand) and it would process the file deposited in the queue</li>
117
118   <li>After that we don't know where the information for this went. We were using Test/1 in the subject line which should update http://gnats-irva-3.broadcom.com/cgi-bin/gnatsweb.pl?debug=&amp;database=IT-Test&amp;cmd=edit&amp;cmd=edit&amp;pr=1
119 but it isn't.</li>
120 </ul>
121
122 <p>I attempted to debug this further and I made a change /tools/gnats/4.0/bin/stripmimed and now:</p>
123
124 <div class="code"><pre>
125 gnats-irva-3:/tools/gnats/4.0/bin/stripmimed
126 /tools/gnats/4.0/bin/stripmimed: line 44: use: command not found
127 /tools/gnats/4.0/bin/stripmimed: line 48: use: command not found
128 /tools/gnats/4.0/bin/stripmimed: line 49: use: command not found
129 /tools/gnats/4.0/bin/stripmimed: line 50: use: command not found
130 /tools/gnats/4.0/bin/stripmimed: line 51: use: command not found
131 /tools/gnats/4.0/bin/stripmimed: line 52: use: command not found
132 /tools/gnats/4.0/bin/stripmimed: line 54: undef: command not found
133 /tools/gnats/4.0/bin/stripmimed: line 56: my: command not found
134 /tools/gnats/4.0/bin/stripmimed: line 57: my: command not found
135 /tools/gnats/4.0/bin/stripmimed: line 58: my: command not found
136 /tools/gnats/4.0/bin/stripmimed: line 60: open: command not found
137 /tools/gnats/4.0/bin/stripmimed: line 61: or: command not found
138 /tools/gnats/4.0/bin/stripmimed: line 63: sub: command not found
139 /tools/gnats/4.0/bin/stripmimed: line 64: my: command not found
140 /tools/gnats/4.0/bin/stripmimed: line 66: print: command not found
141 /tools/gnats/4.0/bin/stripmimed: line 67: syntax error near unexpected token `}'
142 /tools/gnats/4.0/bin/stripmimed: line 67: `} # Log'
143 </pre></div>
144
145 <p>So how did we fix the shebang problem before? Also, why is queue-pr not properly updating the pr? (My suspicion is that the file attachment on this PR is messing up queue-pr - nope, that doesn't seem to be it...</p>
146                               
147                               <p class="entry-footer">
148                                  <span class="post-footers">Posted by  at  6:35 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000493.html">Permalink</a>
149                                  
150                                  
151                               </p>
152                            </div>
153                         </div>
154                      </div>
155                      
156                      
157
158                      <h2 class="date-header">December  7, 2005</h2>
159                      <a id="a000492"></a>
160                      <div class="entry" id="entry-492">
161                         <h3 class="entry-header">BinMerge Module & Perl Issues</h3>
162                         <div class="entry-content">
163                            <div class="entry-body">
164                               <ul>
165   <li>Changed bin_merge to be a module so that it easier to call from UCMCustom</li>
166
167   <li>Integrated new BinMerge.pm module into the UCMCustom</li>
168
169   <li>Added fix to use "\" in get_vob_str</li>
170
171   <li>Changed UCMCustom to use strict and warnings(we should always use these)</li>
172
173   <li>Changed UCMCustom to use use instead of require</li>
174
175   <li>Hunted down bug where UCMCustom undef's $/ (Bad UCMCustom!! Bad!)</lI>
176 </ul>
177                               
178                               <h2>BinMerge Module</h2>
179
180 <p>I decided to change bin_merge into a module (BinMerge) and use it in UCMCustom. I was having problems trying to start the bin_merge process and getting it going in a pipe so the output from verbose could give the user feed back. For some reason bin_merge has to exit before any output was returned. Might have been because of the $/ thing described below (Bad UCMCustom, bad!)</p>
181
182 <h2>Using strict</h2>
183
184 <p>I've been taught that both use strict and use warnings should always be used when coding Perl. These diagnoistic routines are helpful in catching some common Perl mistakes that are otherwise much more difficult to debug. In fact, in implementing this I found a few potential bugs that I also corrected.</p>
185
186 <blockquote>
187 <p><b>Note:</b> Some version of Perl do not have use warnings. Instead specify -w on the #! line.</p>
188 </blockquote>
189
190 <h2>Use vs Require</h2>
191
192 <p>Require is old hat. Use is the new require! From Perldoc's <a href="http://perldoc.perl.org/perlfaq8.html#What%27s-the-difference-between-require-and-use%3F">What's the difference between require and use?</a>:</p>
193
194 <blockquote>
195   <h2>What's the difference between require and use?</h2>
196
197   <p>Perl offers several different ways to include code from one file into another. Here are the deltas between the various inclusion constructs:</p>
198
199   <ol>
200     <li> do $file is like eval `cat $file`, except the former</li>
201       <ol>
202         <li>searches @INC and updates %INC.</li>
203
204         <li>bequeaths an *unrelated* lexical scope on the eval'ed code.</li>
205       </ol>
206
207     <li>require $file is like do $file, except the former</li>
208       <ol>
209         <li>checks for redundant loading, skipping already loaded files.</li>
210
211         <li>raises an exception on failure to find, compile, or execute $file.</li>
212       </ol>
213
214     <li>require Module is like require "Module.pm", except the former</li>
215       <ol>
216         <li>translates each "::" into your system's directory separator.</li>
217
218         <li>primes the parser to disambiguate class Module as an indirect object.</li>
219       </ol>
220
221     <li>use Module is like require Module, except the former</li>
222       <ol>
223         <li>loads the module at compile time, not run-time.</li>
224
225         <li>imports symbols and semantics from that package to the current one.</li>
226       </ol>
227   </ol>
228 </blockquote>
229
230 <p>Note that becuase use loads the module at compile time one need to arrange for the @INC array to have any paths needed for use to succeed (IOW user written modules). In order to accomplish this one need to seed the @INC arrray in a BEGIN block as BEGIN blocks are executed before use is expanded,</p>
231
232 <h2>$/ Bug</h2>
233
234 <p>From Perldoc's <a href="http://perldoc.perl.org/perlvar.html">Perlvar</a>:</p>
235
236 <blockquote>
237   <p>You should be very careful when modifying the default values of most special variables described in this document. In most cases you want to localize these variables before changing them, since if you don't, the change may affect other modules which rely on the default values of the special variables that you have changed. This is one of the correct ways to read the whole file at once:</p>
238
239   <div class="code"><pre>
240   open my $fh, "foo" or die $!;
241   local $/; # enable localized slurp mode
242   my $content = <$fh>;
243   close $fh;
244   </pre></div>
245
246   <p>But the following code is quite bad:</p>
247
248   <div class="code"><pre>
249   open my $fh, "foo" or die $!;
250   undef $/; # enable slurp mode
251   my $content = <$fh>;
252   close $fh;
253   </pre></div>
254
255   <p>since some other module, may want to read data from some file in the default "line mode", so if the code we have just presented has been executed, the global value of $/ is now changed for any other code running inside the same Perl interpreter.</p>
256 </blockquote>
257                               
258                               <p class="entry-footer">
259                                  <span class="post-footers">Posted by  at  5:44 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000492.html">Permalink</a>
260                                  
261                                  
262                               </p>
263                            </div>
264                         </div>
265                      </div>
266                      
267                      
268
269                      <h2 class="date-header">December  6, 2005</h2>
270                      <a id="a000491"></a>
271                      <div class="entry" id="entry-491">
272                         <h3 class="entry-header">Stripmime/Cleardiffmrg/CharacterSetValidation</h3>
273                         <div class="entry-content">
274                            <div class="entry-body">
275                               <ul>
276   <li>Fixed stripmime</li>
277
278   <li>Worked with Shivdutt regarding the cleardiffmrg problem. Turns out to be a leading "/". Shivdutt fixed UCMCustom.pl</lI>
279
280   <li>Turned off character set validation on p4test for PQA. Have not implemented this on production yet</li>
281 </ul>
282                               
283                               <h2>Stripmime</h2>
284
285 <p>After banging my head against stripmime all day I finally figured it out. It would work from the command line but not from sendmail! It turned out to be the fact that I was not setting output_dir rather deferring to cwd and in the context of sendmail and aliases I guess that won't do. Changed stripmime to call $parser->output_dir ("/tmp"). Ravi needs to test this then we can implement.</p>
286
287 <h2>Cleardiffmrg</h2>
288
289 <p>Tommy Kee was having problems with merging where the cleardiffmrg tool would not come up stating instead that it encountered and error. I had seen this sort of error before at Ameriquest but it was specifically with snapshot views and with views that were tagged with forward slashes (something that mktag allows but cleardiffmrg has a problem with). But here we were dealing with dynamic views and the view tags were with all backslashes (\).</p>
290
291 <p>However, UCMCustom.pl would call cleartool findmerge with a leading forward slash (e.g. /andy\path\to\search). I suspected that this leading slash might be causing the problem and eventual showed that it was indeed the problem. Shivdutt changed UCMCustom.pl to use a leading blackslash.</p>
292
293 <h2>CharacterSetValidation</h2>
294
295 <p>I called IBM/Rational support this morning to raise the priority on this one. The priority has been raised and IBM/Rational is investigating this more fully. Meantime they suggested, as a temporary workaround, to turn off checking of code pages. I've tried this:</p>
296
297 <div class="code"><pre>
298     $ installutil setdbcodepagetonochecking -dbset 2005.02.00 admin <password>
299     *********************************************************
300     Starting test setdbcodepagetonochecking
301     *********************************************************
302     Note: setting the code page to 'no checking' can result
303     in data corruption. Please refer to the ClearQuest Release
304     Notes for more information.
305     Successfully set the code page to 'no checking'.
306
307     *********************************************************
308     Exit code 0 for test setdbcodepagetonochecking
309     *********************************************************
310 </pre></div>
311
312 <p>Note that this does not stop the CharacterSetValidation package from complaining! Turning off the CharacterSetValidation requires a schema change to return FALSE from enable_char_set_validation.</p>
313
314                               
315                               <p class="entry-footer">
316                                  <span class="post-footers">Posted by  at  5:20 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000491.html">Permalink</a>
317                                  
318                                  
319                               </p>
320                            </div>
321                         </div>
322                      </div>
323                      
324                      
325
326                      <h2 class="date-header">December  5, 2005</h2>
327                      <a id="a000489"></a>
328                      <div class="entry" id="entry-489">
329                         <h3 class="entry-header">Cleardiffmrg/bin_merge problems</h3>
330                         <div class="entry-content">
331                            <div class="entry-body">
332                               <ul>
333   <li>Told Andrew about new -reuse_stream option to create_dev_snapview.pl. I have him testing this</li>
334
335   <li>Worked with Shivdutt and IBM/Rational on problem with cleardiffmrg. I think I've worked this out to the leading "/" that UCMCustom users.</li>
336
337   <li>Finished stripmime - Ray testing it - created stripmimed that logs to /tmp.</li>
338
339   <li>Worked at getting bin_merge integrated into UCMCustom.pl</li>
340
341   <li>Implemented quick script (topper) to try to catch the hanging problem with ccase-rmna-3</li>
342 </ul>
343                               
344                               <h2>Cleardiffmgr problem</h2>
345
346 <p>The problem occurs during a deliver between projects where there is a merge conflict and UCMCustom wants to have findmerge call up a Cleardiffmgr to resolve the conflicts. I've seen this before WRT snapshot views and view tags with forward slashes at Ameriquest. UCMCustom perfaces' the vob tags with "/".</p>
347
348 <p>But this problem doesn't always happen - in fact most of the time it appears to work. It might be just when there's a merge conflict</p>
349
350 <p>After working with Shivdutt and IBM/Rational on the problem and getting down to reproducing it with a long cleartool findmerge command in the user's environment this problem started happening to me in my test environment as I was integrating bin_merge. After much narrowing down I found:</p>
351
352 <p>Here's some more information. As you know I started having a similar problem as the end user. I paired it down to the following. This fails (but does not always fail):</p>
353
354 <div class="code"><pre>
355     Z:\andys_pvob>cleartool findmerge /andy\bin\cygwin_setup -fver \main\Andrew_Integration\6 -log NUL -gmerge -nc
356     Needs Merge "/andy\bin\cygwin_setup" [to \main\Andrew_Integration\Andrew2_Integration\CHECKEDOUT from \main\Andrew_Integration\6 base \main\Andrew_Integration\5]
357 </pre></div>
358
359 <p>However the following does work:</p>
360
361 <div class="code"><pre>
362     Z:\andys_pvob>cleartool findmerge \andy\bin\cygwin_setup -fver \main\Andrew_Integration\6 -log NUL -gmerge -nc
363     Needs Merge "\andy\bin\cygwin_setup" [to \main\Andrew_Integration\Andrew2_Integration\CHECKEDOUT from \main\Andrew_Integration\6 base \main\Andrew_Integration\5]
364 </pre></div>
365
366 <p>Notice the difference? It's subtle. The first findmerge's path starts with a "/" while the second one starts with a "\".</p>
367
368 <h2>bin_merge integration</h2>
369
370 <p>My bin_merge script remains it's own process. This will be useful if others wish to use this process. However UCMCustom needs to incorporate calling bin_merge. I'm currently having a problem with this because I want to start bin_merge as a pipe so I can give the user feedback. But bin_merge runs to completion before the first output is received. I don't know why this is happening as it doesn't happen in a smaller test.pl environment, only under the massive UCMCustom.pl...</p>
371                               
372                               <p class="entry-footer">
373                                  <span class="post-footers">Posted by  at  7:54 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000489.html">Permalink</a>
374                                  
375                                  
376                               </p>
377                            </div>
378                         </div>
379                      </div>
380                      
381                   </div>
382                </div>
383             </div>
384          </div>
385       </div>
386    </div>
387 </body>
388 </html>