Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15498 closed bug (fixed)

hardlink_packages.py misorders versions of any arch packages sometimes

Reported by: kallisti5 Owned by: bonefish
Priority: normal Milestone: R1/beta2
Component: Build System Version: R1/Development
Keywords: hardlink Cc:
Blocked By: Blocking:
Platform: All

Description

hardlink_packages.py will mis-parse versions sometimes resulting in unexpected results.

Example:

Leverage hardlink_packages.py, and provide a source package pool with gnu_efi_kernel 3.0.9-1 and 3.0.10-1.

hardlink_packages.py will silently adjust the arm repo back to use 3.0.9 instead of 3.0.10.

I'm assuming the parsing of 9 > 1.

Workaround is to select just the packages you want for the source pool, and remove older packages from it.

Attachments (1)

hardlink-test.tar.gz (528 bytes ) - added by kallisti5 5 years ago.

Download all attachments as: .zip

Change History (6)

by kallisti5, 5 years ago

Attachment: hardlink-test.tar.gz added

comment:1 by epremuz, 5 years ago

Problem is in line 66. A dirty hack can be to replace this block:

if (pkgVersion.startswith(pkgname + '-') and ((greatestVersion == None) or (pkgVersion > greatestVersion))):
	greatestVersion = pkgVersion

With something like this:

try:
	if (pkgVersion.startswith(pkgname + '-') and ((greatestVersion == None) or (int(pkgVersion) > int(greatestVersion)))):
		greatestVersion = pkgVersion
except:
	if (pkgVersion.startswith(pkgname + '-') and ((greatestVersion == None) or (pkgVersion > greatestVersion))):
		greatestVersion = pkgVersion

In other words, attempt to compare the strings converted to integers and if conversion is not possible then do it as it was done before (wrong, but you still get something).

comment:2 by pulkomandy, 5 years ago

I would think haikuporter has a more accurate version comparison algorithm "ritten in python? In't more complex than you'd think with the ~beta, etc things

comment:4 by waddlesplash, 5 years ago

Resolution: fixed
Status: newclosed

As this is only a problem when pointing the hardlink_packages tool at its own packages directory, and not the actual package repository, I just used distutils' version comparator. Fixed in hrev54063.

comment:5 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.