Changeset 561:e24cf77618c9

Show
Ignore:
Timestamp:
06/01/08 20:58:12 (7 months ago)
Author:
David Anderson <dave@…>
Branch:
default
Message:

Make copyright_report.py smarter about extracting filepaths.

It now no longer chokes on deletions (filepath /dev/null) and
diffs contained within the diff (more than 3 '+' at the start
of a line).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • scripts/copyright_report.py

    r559 r561  
    8181 
    8282for line in sys.stdin: 
    83     if line.startswith('+++'): 
    84         filepath = line.split()[1][2:] 
     83    if line.startswith('+++ '): 
     84        filepath = line.split()[1] 
     85 
     86        # Skip deletions 
     87        if filepath == '/dev/null': 
     88            continue 
     89 
     90        if filepath[:2] in ('a/', 'b/'): 
     91            filepath = filepath[2:] 
     92 
    8593        if not check_file(filepath): 
    8694            ok = False