RPM::Ve...nCompare(3)
π RPM::VersionCompare β the manual page, bestie edition π
okay so you found the manual page for RPM::VersionCompare, from the User Contributed Perl Documentation section, page RPM::Ve...nCompare(3) (yes the name is squished, it's just RPM::VersionCompare(3) fr fr). it's a Perl module that compares RPM version strings, and honestly? it ate. let's get into it π
β¨ NAME β¨
RPM::VersionCompare β compare RPM version strings π
πΈ SYNOPSIS πΈ
here's the whole vibe, literally copy-paste:
use RPM::VersionCompare;
RPM::VersionCompare::rpmvercmp('1.0', '0.9');
RPM::VersionCompare::labelSplit('4:5.12.0-140');
RPM::VersionCompare::labelCompare('4:5.12.0-140', '5.14.1');
π¦ DESCRIPTION π¦
okay so this module gives you functions to compare RPM version strings. No function is exported by default. like, you gotta call them fully qualified, bestie, there's no use RPM::VersionCompare qw(...) freebie here. π
if possible, calls are passed to the native librpm library. otherwise, the Python extension provided with RPM sources is re-implemented. so either way, you're covered. periodt. π
π labelCompare(LABEL1, LABEL2)
compares two version strings including epoch and release. the returns are:
- returns
1if LABEL1 is bigger - returns
0if LABEL1 equals LABEL2 - returns
-1otherwise
that's it. that's the whole function. iconic. β¨
π§ labelSplit(LABEL)
splits a version LABEL (e.g. "4:5.12.0-140") into epoch, version and release. the epoch and release parts are optional, bestie β if they miss, the separator (collon for epoch, hyphen for release) should miss too, and their implicit value is 0. no cap.
see <http://www.rpm.org/wiki/PackagerDocs/Dependencies#RequiringPackages> for the specification. iykyk π
if LABEL is in correct format, an array (EPOCH, VERSION, RELEASE) will be returned. otherwise undef is returned. so likeβ¦ vibe check your input first or you're getting undef and a sad little moment π
π rpmvercmp(VERSION1, VERSION2)
compares two RPM version strings by calling the librpm function rpmvercmp(). It does not support strings with RPM epoch or release. (use labelCompare() if you need to support epoch or release β that's literally what it's for.)
it will return:
1if VERSION1 string is bigger0if strings are equal-1if VERSION1 is lesser
clean, simple, main character energy β
π AUTHOR π
Petr PΓsaΕ <ppisar@redhat.com> β ty for your service π«Ά
π COPYING π
Copyright (C) 2011 Petr PΓsaΕ <ppisar@redhat.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
lowkey important: this is GPLv3-or-later, and there is genuinely no warranty of any kind. don't come for the author if it breaks, that's the deal. π
and that's the page, bestie!! π this one's from perl v5.42.0, dated 2025-07-25, and that footer is the cutest little timestamp. go compare some versions, you got this πΈβ¨π¦π
π¦ where this page comes from
- fedora 43: perl-RPM-VersionCompare 0.1.1-54.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms