[haiku-bugs] Re: [Haiku] #15498: hardlink_packages.py misorders versions of any arch packages sometimes

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 10 Dec 2019 00:41:52 -0000

#15498: hardlink_packages.py misorders versions of any arch packages sometimes
----------------------------+----------------------------
   Reporter:  kallisti5     |      Owner:  bonefish
       Type:  bug           |     Status:  new
   Priority:  normal        |  Milestone:  Unscheduled
  Component:  Build System  |    Version:  R1/Development
 Resolution:                |   Keywords:  hardlink
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  All
----------------------------+----------------------------
Comment (by epremuz):

 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).
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15498#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: