version comparisment fails

Bug #761515 reported by miracle_bg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sparkle
Won't Fix
Undecided
Unassigned

Bug Description

Sparkle cannot properly select the latest uploaded upgrade version from our RSS published list of updates.

We are using internal SVN build numbers (so the version looks like - X.X.X.X (1.0.0.100), where the short version we specify as: 1.0.0 and the full as - 100.

I am attaching the version of the xml we are using (or available at: http://download.stampii.com/updates/mac/releases.rss).

The problem is that Sparkle is using the first build it finds in the XML. I tried to swap the places of the items in the list - no difference.

Then i dag into the source code and i reached this piece of code where it tries to find the valid version:

SUBasicUpdateDriver.m (92): /- (void)appcastDidFinishLoading:(SUAppcast *)ac/

  // Find the first update we can actually use.
  NSEnumerator *updateEnumerator = [[ac items] objectEnumerator];
  do {
   item = [updateEnumerator nextObject];
  } while (item && ![self hostSupportsItem:item]);
 }

SUBasicUpdateDriver.m (60):

- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
{
 if ([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) { return YES; }
 return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending;
}

Why is Sparkle first checking if there is a minimumSystemVersion and returning YES? This parameter is not required.

The logic as it seems here is that it will iterate among all possible updates and it will select the first possible update - wheres - i believe it must separate ALL possible updates first - and then select the best one from them.

Right now because i am not specifying minimumSystemVersion - it just picks the first available update in the list and it thinks this is the last one - which is not correct at all.

Revision history for this message
miracle_bg (miracle-nimasystems) wrote :
Changed in sparkle:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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