patacongo commented on issue #528: sched/mqueue:  Correct/update license 
headers.
URL: https://github.com/apache/incubator-nuttx/pull/528#issuecomment-597271673
 
 
   > * Ruler width: should the tool try to guess the block comment width from 
looking at the other block comments in the file? Or just the initial license 
block comment?
   
   I think your tool should preserver the existing ruler, file name, and file 
description in the file without changing them at all.  You should not guess the 
block comment length.  You should preserve what's there without no modification 
to the first N lines where
   
   Line 1:  The opening, "top" ruler,
   Line 2:  The file name
   Line 3-(N-3): Option file description
   Line N: "* "
   >
   > * First N lines: There can be important info in the first lines of the 
license block, so the tool should preserve everything up to the first `* ` line 
(blank line starting with a `*`)
   
   Right, then don't care about the ruler width at all.  Just preserve it.  The 
first line to be changed should be the line that contains the string Copyright
   
   The last line that you should change should contain "POSSIBILITY OF SUCH 
DAMAGE."
   
   > * Retain everything at the end of the license: Do you mean just the bottom 
block close of `*`'s?
   
   Retain everything after "POSSIBILITY OF SUCH DAMAGE."
   
   I don't think anyone has respaced the header but I suppose that is a 
possibility.  The word DAMAGE appears twice in the BSD license.  But only one 
with the period.  So "DAMAGE." would be a safe match
   
   You could even use sed to get the range of license lines to be changed:
   
       $ grep -n Copyright sched/init/nx_start.c
       4: *   Copyright (C) 2007-2014, 2016, 2018 Gregory Nutt. All rights 
reserved.
   
       $ grep -n "DAMAGE[.]" sched/init/nx_start.c
       32: * POSSIBILITY OF SUCH DAMAGE.
   
   So you would need to remove lines 4-32 and insert the new license at line 4.
   
   So if you carefully select the files to be modified (as I suggest in a 
little script above) and just replace BSD lines from the line containing 
"Copyright" to the line containing "DAMAGE." and insert the Apache 2.0 license 
at the same position.
   
   you could probably really do all of that with head, cat, and tail
   
   Greg
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to