<p>There are cases when the <code>rpmvercmp()</code> function compares two different version strings as equal.</p>
<p>For example, in some cases adding a plus <code>+</code> character at the end of the version denotes that this version is the base version plus some changes. This is the case of the Linux kernel build system where the since the <a href="https://elixir.bootlin.com/linux/latest/source/scripts/setlocalversion#L173" rel="nofollow">setlocalversion</a> scripts appends a <code>+</code> if the <code>CONFIG_LOCALVERSION_AUTO</code> option is not enabled.</p>
<p>Then if two options are compared using the <code>rpmvercmp()</code> function, it will wrongly do <code>rpmvercmp("5.3.0","5.3.0+") == 0</code> even when the versions are not the same.</p>
<p>The Fedora GRUB sorts the boot entries using the same algorithm than <code>rpmvercmp()</code>, so a locally built kernel will not appear in the boot menu due the comparing function thinking that this entry is already present, i.e: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1767395" rel="nofollow">https://bugzilla.redhat.com/show_bug.cgi?id=1767395</a></p>
<p>It seems this is not the only case since in PR <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="381505789" data-permission-text="Issue title is private" data-url="https://github.com/rpm-software-management/rpm/issues/597" data-hovercard-type="pull_request" data-hovercard-url="/rpm-software-management/rpm/pull/597/hovercard" href="https://github.com/rpm-software-management/rpm/pull/597">#597</a> that added support for sorting <code>^</code> higher than base version, a user <a href="https://github.com/rpm-software-management/rpm/pull/597#issuecomment-446217948" data-hovercard-type="pull_request" data-hovercard-url="/rpm-software-management/rpm/pull/597/hovercard">commented</a> that <code>+</code> should also be supported.</p>
<p>An RFC pull-request fixing the specific case of <code>+</code> is <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="517187629" data-permission-text="Issue title is private" data-url="https://github.com/rpm-software-management/rpm/issues/924" data-hovercard-type="pull_request" data-hovercard-url="/rpm-software-management/rpm/pull/924/hovercard" href="https://github.com/rpm-software-management/rpm/pull/924">#924</a>. But this is just a special case of a more generic problem.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/925?email_source=notifications&email_token=ADLPZU37ENIFJZA7BZZQ3GTQSAZ2FA5CNFSM4JIUYFZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWT6LOQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUZAWQYW442PPO3EQ53QSAZ2FANCNFSM4JIUYFZA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ADLPZU7UTXUZJZ4ADFWQURTQSAZ2FA5CNFSM4JIUYFZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWT6LOQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/925?email_source=notifications\u0026email_token=ADLPZU37ENIFJZA7BZZQ3GTQSAZ2FA5CNFSM4JIUYFZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWT6LOQ",
"url": "https://github.com/rpm-software-management/rpm/issues/925?email_source=notifications\u0026email_token=ADLPZU37ENIFJZA7BZZQ3GTQSAZ2FA5CNFSM4JIUYFZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWT6LOQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>