Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the package version comparison algorithm work?

0
Posted

How does the package version comparison algorithm work?

0

Say we have foo-1.1.3-i386-1rob and foo-1.1.3-i686-1. The version parts will be compared, first 1, then 1, then 3. At this point, both packages are equal, since 1.1.3 == 1.1.3. If one is greater at this point, the version check returns. Then, it checks to make sure that both pkgs have the same number of “version parts”. This is the case in this example, both have 3 (1,1,3). This is useful when you see packages like 1.2 and 1.2.1. Whichever has more parts wins. At this point, we know if one only has 2 parts, and the other has 3, then the first two parts of both version strings have to be equal. Then, the package versions are checked to see if they follow the Slackware convention. This is determined by checking the first instance of ‘-‘ against the last instance. If the pointer returned from index and rindex are different, then we assume we have at least two package version separators (meaning we should have an upstream version, arch, and build at least). If two separators are found, the

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123