Changelog URL parsing not working correctly

Bug #1011093 reported by Sami Jaktholm
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

The URL parser doesn't parse all entries it should from the changelog. As the searching is started from the beginning of the changelog ('iter' variable set to the start), Software Updater takes the first search term and tries to find a match from the changelog starting from position defined by the 'iter' variable. If/when a match is found, Software Updater determines the end of the expression and inserts tag over that expression. Once the part of the changelog is tagged, 'iter' is set to the end of the match and search continues until there's no more matches. Then the next search term is picked up and the process starts with new search term.

However because the 'iter' variable was just set to the end of the last match, the searching doesn't start from the beginning of the changelog - it starts at the end of last found match because variable 'iter' is currently pointing there. This makes the Software Updater to miss some links it could show to the user. This problem can be seen by running 'python UpdateManager/ChangelogViewer.py' (the http link is tagged but LP: #XXX above it isn't).

The worst case scenario is that there's an http adress at the end of the changelog. Because 'http' is the first search term, Software Updater finds the link, tags in and sets 'iter' variable point to the end of the changelog. After this none of the other matches Software Updater could tag (like all LP: #XXXXXX, Closes #YYYYYY etc.) are tagged because the searching always starts from the end and there's nothing to find.

I've attached a patch that should fix this problem (it restores 'iter' back to the beginning every time new search term is selected).

This bug happens in Quantal but as the code is same as in Precise it should be happening there too.

Tags: patch
Revision history for this message
Sami Jaktholm (sjakthol) wrote :
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-url-parsing" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for this patch. I've uploaded it to the bzr branch for update-manager.

Changed in update-manager (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:0.174

---------------
update-manager (1:0.174) quantal; urgency=low

  * UpdateManager/ChangelogViewer.py: improve url parsing of changelog files
    so that more links are created. Thanks to sampo555 for the patch
    (LP: #1011093).
  * Add a dependency to update-manager on update-notifier (LP: #1043725)
 -- Brian Murray <email address hidden> Wed, 19 Sep 2012 09:56:12 -0700

Changed in update-manager (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.