Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_11_20.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: November 20, 2005 - November 26, 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_13.html" title="November 13, 2005 - November 19, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_11_27.html" title="November 27, 2005 - December  3, 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_13.html">&laquo; November 13, 2005 - November 19, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_11_27.html">November 27, 2005 - December  3, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">November 23, 2005</h2>
44                      <a id="a000484"></a>
45                      <div class="entry" id="entry-484">
46                         <h3 class="entry-header">Forking in PerlTk</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Continued to help several users with connecting to the new Controller Clearquest Database for Vinh's users</li>
51
52   <li>Added Version Tree button to the bin_merge prompt dialog box.</li>
53
54   <li>Resolved problem with forking from PerlTk</li>
55 </ul>
56                               
57                               <h2>Forking in PerlTk</h2>
58
59 <p>The issue here is that calling fork(2) in general on Windows just doesn't work well. Clearcase's Perl is based on ActiveState Perl and ActiveState Perl is not the best implementation of Perl. Cygwin's Perl is by far a much better implementation but Cygwin's Perl works from a true Posix environment which is specifically what Cygwin is all about. However Cygwin's Perl does not support PerlTk (I posted on Cygwin's mailing list about this - it would be great if Cygwin would finally support PerlTk) and Cygwin would need to be present on all Windows systems.</p>
60
61 <p>In general, while fork(2) does work under ActiveState is does not work if you have Tk objects created. Chris had suggested to use "start &lt;program&gt;" which is fine - for Windows - but would fail in Unix. I like to wrote my code such that it works on both Windows and Unix. So I tried in vain to get fork to work. However, ActiveState's fork(2) call is horribly broken so I had to code around it like this:</p>
62
63 <div class="code"><pre>
64 sub VersionTree {
65   my $file = shift;
66
67   my $cmd =  "cleartool lsvtree -graphical $file";
68
69   if ($^O =~ /mswin|cygwin/i) {
70     system "start /b $cmd";
71   } else {
72     my $pid = fork;
73
74     return if $pid;
75
76     system $cmd;
77     exit;
78   } # if
79 } # VersionTree
80 </pre></div>
81                               
82                               <p class="entry-footer">
83                                  <span class="post-footers">Posted by  at  1:59 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000484.html">Permalink</a>
84                                  
85                                  
86                               </p>
87                            </div>
88                         </div>
89                      </div>
90                      
91                      
92
93                      <h2 class="date-header">November 21, 2005</h2>
94                      <a id="a000483"></a>
95                      <div class="entry" id="entry-483">
96                         <h3 class="entry-header">Remaining PQA Issues/GNATS stripmime</h3>
97                         <div class="entry-content">
98                            <div class="entry-body">
99                               <ul>
100   <li>Worked with Vinh's group and adjusting to life with the new Controller CQ Database. Wrote instructions for how to unsubscribe to some Broadcom email distribution lists</li>
101
102   <li>Documented how to install the new Clearquest Client Software</li>
103
104   <li>Coded stripmime filter for GNATS.</li>
105 </ul>
106                               
107                               <h2>Stripmime</h2>
108
109 <p>The script described above basically takes as input an email message. It then extracts the header portion and the body portion. It uses some CPAN modules (MIME::Base64 and MIME::Tools as well as MIME::Parser) to analyze the message and obtain the message "parts". Some transformations are performed on the header information and then it is written to stdout. For the plaintext part (if present) it will again write out the message to stdout Other, non-textual parts (AKA attachments) are written to a subdirectory based on the message name/number and a note is included to stdout indicating were to find the attachment.</p>
110
111 <p>The stripemime script placed in /tools/gnats/4.0/bin does the same thing except that attachments are disregarded and no mention of them are written to stdout. However there is an implicit assumption above that there does exist at least one plaintext version of the mail message. This need not be the case. I know, for example, when using Thunderbird I have the option of sending email as HTML, plain text or both. I tend to send both, which are  epresented in the raw email as MIME multipart with the first part being a plaintext version of the HTML, which is sent as the second multipart as HTML. However, if I were to select HTML Only I would not get the plaintext part.  Stripemime, as currently coded would generate a blank email message.</p>
112
113 <p>Also, on gnats-irva-3, could my shell be set to bash? I've tried to set it but I get permission denied. Also, I don't appear to have a home directory set to /home/adefaria for the gadefaria user?</p>
114
115 <p>Finally, MIME::Parser is not installed on gnats-irva-3:</p>
116
117 <div class="code"><pre>
118 gnats4@gnats-irva-3[+1035] bin/stripmime
119 Can't locate MIME/Parser.pm in @INC (@INC contains:
120 /tools/perl/5.004_04/SunOS/lib/sun4-solaris/5.00404
121 /tools/perl/5.004_04/SunOS/lib
122 /tools/perl/5.004_04/SunOS/lib/site_perl/sun4-solaris
123 /tools/perl/5.004_04/SunOS/lib/site_perl .) at bin/stripmime line 47.
124 BEGIN failed--compilation aborted at bin/stripmime line 47.
125 </pre></div>
126
127 <p>I had managed to install MIME::Parser on my Cygwin system using "perl
128 -MCPAN -e 'install MIME::Parser'"</p>
129                               
130                               <p class="entry-footer">
131                                  <span class="post-footers">Posted by  at  5:38 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000483.html">Permalink</a>
132                                  
133                                  
134                               </p>
135                            </div>
136                         </div>
137                      </div>
138                      
139                   </div>
140                </div>
141             </div>
142          </div>
143       </div>
144    </div>
145 </body>
146 </html>