Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2004_12_19.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 19, 2004 - December 25, 2004 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_2004_12_12.html" title="December 12, 2004 - December 18, 2004" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2004_12_26.html" title="December 26, 2004 - January  1, 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_2004_12_12.html">&laquo; December 12, 2004 - December 18, 2004</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2004_12_26.html">December 26, 2004 - January  1, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">December 22, 2004</h2>
44                      <a id="a000263"></a>
45                      <div class="entry" id="entry-263">
46                         <h3 class="entry-header">los178 build</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50
51 <li>Finished los178 build of sources with fixed copyrights!</li>
52
53 <li>Still an error with the non development build of los178 :-(</li>
54
55 <li>Made more progress on cmptags.pl (a Perl script to compare and report on the difference in terms of revisions and associated ECRs, authors and dates between two tags in CVS)</li>
56
57 </ul>
58                               
59                               <p>First I obtained the latest TOT for los178 - apparently they are still fixing things. This makes it imperative that fix_copyright.pl work flawlessly. Was able to build los178 from old, unmodified sources thus I know I'm starting from a good set of sources.</p>
60
61 <p>Next was to run fix_copyright.pl and attempt a compile. This time, instead of just hand editing the files I examined the file in question and why fix_copyright.pl failed in this case. Then fix fix_copyright.pl and repeat.</p>
62
63 <p>One problem was that some files have MS-DOS line endings. Fixed this by removing such line endings and making them standard Unix line endings.</p>
64
65 <p>Next some files ended the comment block with */ and then some additional spaces. This was fixed by not attempting to anchor the end comment block match with the end of the line (i.e. $).</p>
66
67 <p>Injected these actual two or three files back into the build process until it built.</p>
68
69 <p>For safety's sake I then destroyed my build area and recreated from scratch with cvs update -C then running fix_copyright.pl again and bringing that over to grumpy.</p>
70
71 <p>WRT cmptags.pl, made some more progress parsing cvs log info...</p>
72                               
73                               <p class="entry-footer">
74                                  <span class="post-footers">Posted by  at  3:28 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000263.html">Permalink</a>
75                                  
76                                  
77                               </p>
78                            </div>
79                         </div>
80                      </div>
81                      
82                      
83
84                      <h2 class="date-header">December 21, 2004</h2>
85                      <a id="a000262"></a>
86                      <div class="entry" id="entry-262">
87                         <h3 class="entry-header">Fixing fix_copyright.pl</h3>
88                         <div class="entry-content">
89                            <div class="entry-body">
90                               <ul>
91
92 <li>Decided to improve fix_copyright.pl. If two copyrights appear in a single copyright block it now just leaves that copyright intact.</li>
93
94 <li>Attempted rebuild of los178 and working out problems</li>
95
96 <li>Developing a better CVS report Perl script</li>
97
98 </li> 
99                               
100                               <p>Generally these copyright blocks with two copyrights are of the form described yesterday, with a single copyright line added for LynuxWorks. Such files will not be modified</p>
101
102 <p>Need to work out remaing los178 build problem and make fix_copyright handle them too.</p>
103
104 <p>Tried to get a Perl CVS module instead of coding it myself - seems there are no complete Perl CVS modules on CPAN!</p>
105                               
106                               <p class="entry-footer">
107                                  <span class="post-footers">Posted by  at  3:18 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000262.html">Permalink</a>
108                                  
109                                  
110                               </p>
111                            </div>
112                         </div>
113                      </div>
114                      
115                      
116
117                      <h2 class="date-header">December 20, 2004</h2>
118                      <a id="a000261"></a>
119                      <div class="entry" id="entry-261">
120                         <h3 class="entry-header">Improving fix_copyright.pl</h3>
121                         <div class="entry-content">
122                            <div class="entry-body">
123                               <ul>
124
125 <li>Still unable to build 3.2.2/5.0.0 natively</li>
126
127 <li>Worked on improving algorithm for copyright replacement</li>
128
129 </ul>
130                               
131                               <p>I'm finding it very difficult to develop a hueristic algorithm to find what I call "LynuxWorks copyright blocks" in existing source files. The problem is that the input data is not necessarily consistant. Sure we can go for the 80% fix and hand fix the rest (in fact, that's what I did before) however those 20% often cause compiler errors during the build. What's potential worse is that it is possible that some files will be altered in such a way as to not produce a compiler error but rather to change behavior of the resulting code.</p>
132
133 <p>My current algorithm attempts to do the following:</p>
134
135 <ul>
136   <li>Locate the start of a C comment (i.e. "/*"). This comment must be at the beginning of the line (for now I am not considering inline comments as the chances of these containing a bona fide copyright statement is unlikely).</il>
137
138   <li>Scan until the enclosing end comment (i.e. "*/"). Again this must appear at the end of a line ($).</li>
139
140   <li>Take those lines and examine them for the works "(C) Copyright" and "LynuxWorks" (additionally I found some files that had "LynuxWork,").</li>
141
142   <li>If found then the comment block it throw out (to be replaced by the new, more consistent copyright block.</li>
143
144 </ul>
145
146 <p>Currently the "official" copyright block is of the form:</p>
147
148 <div class="code">
149 <pre>
150     /* vi: ts=4 sw=4
151     *************************************************************
152     (C) Copyright $copy
153     LynuxWorks, Inc.
154     San Jose, CA
155     All rights reserved.
156
157     $Date: $Date$
158     $Revision: $Revision$
159     $Source: $Source$
160     ************************************************************/
161 </pre>
162 </div>
163
164 <p>The "$copy" is replaced by the copyright date found in the file. Dates of the form <year> are changed to <year>-<current year> (unless <year> == <current year>. Dates of the form <year1>, <year2>, <year3> are changed to <year1>-<curernt year>. In order to make finding such copyright information eaiser in the future I would suggest changing the above format to:</p>
165
166 <div class="code">
167 <pre>
168     /* Start Copyright ******************************************
169     vi: ts=4 sw=4
170     (C) Copyright $copy LynuxWorks, Inc.
171     San Jose, CA
172     All rights reserved.
173
174     $Date: $Date$
175     $Revision: $Revision$
176     $Source: $Source$
177     * End Copyright *********************************************/
178 </pre>
179 </div>
180
181 <p>This would 1) retain the "vi: ts=4 sw=4" annotation that I assume is for vi users, 2) group both the copyright string ("(C) Copyright") along with the company name of LynuxWorks on the same line. This makes it easier to grep for in the future considering some files have Rockwell copyrights. 3) Clearly delineates the start and stop of the copyright block.</p>
182
183 <p>The problems that I'm having is that I'm seeing copyright blocks of the following forms:</p>
184
185 <div class="code">
186 <pre>  /************************************************************
187     (C) Copyright 1987-2000
188     Lynx Real-Time Systems, Inc.
189     San Jose, CA
190     All rights reserved.
191
192     $Date: 2003/11/14 22:44:44 $
193     $Revision: 1.1 $
194     ************************************************************/
195 </pre>
196 </div>
197
198 <p>(Does not contain LynuxWorks, rather Lynx Real-Time Systems)</p>
199
200 <div class="code">
201 <pre>
202     /*
203     .FP
204     ***********************************************************************
205      Revision History
206      See ClearCase
207      Version:
208     ***********************************************************************
209     *
210     * EXPORT NOTICE:
211     *
212     *   INFORMATION SUBJECT TO EXPORT CONTROL LAWS
213     *
214     * Subject to local country rules and laws when applicable, you
215     * must comply with the following:
216     *
217     * These commodities, technology, or software were exported from
218     * the United States in accordance with the Export Administration
219     * Regulations.  Diversion contrary to U. S. law and other relevant
220     * export controls is prohibited.   They may not be re-exported to
221     * any of the following destinations without authorization; Cuba,
222     * Iran, Iraq, Libya, North Korea, Sudan or any other country to
223     * which shipment is prohibited; nor to end-use(r)s involved in
224     * chemical, biological, nuclear, or missile weapons activity.
225     *
226     * COPYRIGHT NOTICE:
227     *   (C) Copyright 2001 Rockwell Collins, Inc.  All rights reserved.
228     *
229     * FILE NAME:
230     *   df.c
231     *
232     * PURPOSE:
233     *   utility to display disk usage
234     *
235     * NOTES:
236     *
237     * ABBREVIATIONS/ACRONYMS:
238     *
239     *****************************************************************
240     .FP END
241     */
242     /************************************************************
243     (C) Copyright 1987-1996
244     Lynx Real-Time Systems, Inc.
245     San Jose, CA
246     All rights reserved.
247
248     $Date: 2003/09/10 15:24:57 $
249     $Revision: 1.1.1.1 $
250     ************************************************************/
251 </pre>
252 </div>
253
254 <p>Contains multiple "(C) Copyright" strings, one being ours and the other being Rockwell's. Should both exist in the resultant file?</p>
255
256 <div class="code">
257 <pre>
258     /*
259     .FP
260      **********************************************************************
261      *
262      * FILE NAME:
263      *   hm_load_header.c
264      *
265      * PURPOSE:
266      *    Performs the integrity check of the program and data files
267      *    in the CPR read only file system.
268      *
269      * ABBREVIATIONS/ACRONYMS: (optional)
270      *
271      * NOTES: none
272      *
273      * COPYRIGHT NOTICE:
274      *   (C) Copyright 2001-2002 Rockwell Collins, Inc.  All rights reserved.
275      *       Proprietary and confidential material.  Distribution,
276      *       use, and disclosure restricted by Rockwell Collins, Inc.
277      *    Copyright (c) 2003-2004, LynuxWorks, Inc. All Rights Reserved.
278      *
279      ***********************************************************************
280     .FP END
281     */
282 </pre>
283 </div>
284
285 <p>Contains multiple "(C) Copyright" strings, one being ours and the other being Rockwells, in the same comment block! Also notice the inconsistant form of one bying "(C) Copyright" while the other being "Copyright (C)". How should this case be handled?</p>
286                               
287                               <p class="entry-footer">
288                                  <span class="post-footers">Posted by  at  5:55 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000261.html">Permalink</a>
289                                  
290                                  
291                               </p>
292                            </div>
293                         </div>
294                      </div>
295                      
296                   </div>
297                </div>
298             </div>
299          </div>
300       </div>
301    </div>
302 </body>
303 </html>