Merge lp:~cjwatson/launchpad/sync-source-section-priority-581697 into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Julian Edwards
Approved revision: no longer in the source branch.
Merged at revision: 10870
Proposed branch: lp:~cjwatson/launchpad/sync-source-section-priority-581697
Merge into: lp:launchpad
Diff against target: 16 lines (+4/-2)
1 file modified
scripts/ftpmaster-tools/sync-source.py (+4/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/sync-source-section-priority-581697
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+25434@code.launchpad.net

Commit message

If Section or Priority is missing from the Source stanza of debian/control, leave it as "-" in the generated .changes file rather than setting it to "None".

Description of the change

If Section or Priority is missing from the Source stanza of debian/control, leave it as "-" in the generated .changes file rather than setting it to "None".

Fixes bug 581697.

I haven't included any tests as sync-source.py in general is untested, and in any case is due to be replaced eventually with API calls which I don't think should have this problem. Test case is in the bug, reproducible with 'sync-source.py -S unstable bglibs' as the lp_archive user on cocoplum with ~lp_archive/syncs/ as the current directory (or another Soyuz instance that has Debian_unstable_main_Sources in the current directory as a gunzipped copy of http://ftp.debian.org/debian/dists/unstable/main/source/Sources.gz).

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Thanks for the fix Colin. I'll land this with a small style tweak as it's LP style to not compare for None like that, we do an explicit check. Your code then becomes:

if section is not None:
    source_section = section

for example.

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

In that case there are two other instances of the same comparison style in that function that should be changed in the same way ('if source' and 'if package').

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/ftpmaster-tools/sync-source.py'
2--- scripts/ftpmaster-tools/sync-source.py 2010-04-22 17:30:35 +0000
3+++ scripts/ftpmaster-tools/sync-source.py 2010-05-17 13:47:29 +0000
4@@ -267,8 +267,10 @@
5 priority = Control.Section.Find("Priority")
6 description = Control.Section.Find("Description")
7 if source:
8- source_section = section
9- source_priority = priority
10+ if section:
11+ source_section = section
12+ if priority:
13+ source_priority = priority
14 source_name = source
15 if package and package == source_name:
16 source_description = (