Merge lp:~lasall/python-distutils-extra/fixbug-893337 into lp:python-distutils-extra

Proposed by Dominique Lasserre
Status: Merged
Merged at revision: 306
Proposed branch: lp:~lasall/python-distutils-extra/fixbug-893337
Merge into: lp:python-distutils-extra
Diff against target: 20 lines (+6/-4)
1 file modified
DistUtilsExtra/auto.py (+6/-4)
To merge this branch: bzr merge lp:~lasall/python-distutils-extra/fixbug-893337
Reviewer Review Type Date Requested Status
Martin Pitt (community) Needs Fixing
Review via email: mp+120028@code.launchpad.net

Description of the change

Hi, this should close #893337.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This has some bugs (iterates through all the lines, not just until the decision is made), calls src_mark several times, and reads the whole file into memory. It also needs a test case.

But I do agree that this should get fixed. Thanks for the initial patch!

review: Needs Fixing
Revision history for this message
Martin Pitt (pitti) wrote :

Also, I think it's still ok to require that a manpage starts with .TH, but we should ignore all .\ lines before it.

Revision history for this message
Martin Pitt (pitti) wrote :

Merged and fixed. Thanks!

Revision history for this message
Dominique Lasserre (lasall) wrote :

Hi Martin, thank you for your comments about the fix! And your fix of the fix. ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUtilsExtra/auto.py'
2--- DistUtilsExtra/auto.py 2012-08-15 09:16:33 +0000
3+++ DistUtilsExtra/auto.py 2012-08-16 23:48:04 +0000
4@@ -320,10 +320,12 @@
5
6 mans = {}
7 for f in src_fileglob(src, '*.[0123456789]'):
8- line = open(f).readline()
9- if line.startswith('.TH '):
10- src_mark(src, f)
11- mans.setdefault(f[-1], []).append(f)
12+ for line in open(f).readlines():
13+ if line.startswith('.\"'):
14+ continue
15+ if line.startswith('.TH '):
16+ src_mark(src, f)
17+ mans.setdefault(f[-1], []).append(f)
18 v = attrs.setdefault('data_files', [])
19 for section, files in mans.items():
20 v.append((os.path.join('share', 'man', 'man' + section), files))

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: