AptPkg::Version(3pm)
π NAME π
AptPkg::Version β the APT package versioning class, bestie. It's a perl thing (we're in section 3pm, iykyk).
β¨ SYNOPSIS β¨
use AptPkg::Version;
That's it. That's the whole vibe check. π«Ά
πΈ DESCRIPTION πΈ
Okay so the AptPkg::Version module hands you an interface to APT's package version handling. Basically: version comparison brain, borrowed straight from APT, no cap. π§ β¨
π AptPkg::Version
The AptPkg::Version package implements the APT pkgVersioningSystem class. Iconic behaviour, tbh.
You don't just make one out of thin air, though β you get an instance of the AptPkg::Version class by grabbing the "versioning" method off an AptPkg::System object. That's the plug. π
The following methods are implemented:
label
Returns the description of the versioning system. For example, on Debian systems you get:
Standard .deb
Short, simple, ate. π
compare(A, B)
Compares package version A against B. It returns:
- a negative value if A is an earlier version than B
- zero if they're the same
- a positive value if A is a later version than B
rel_compare(A, B)
Compares distribution release numbers. Same energy, different numbers. π
check_dep(PKG, OP, DEP)
Checks that the package version PKG satisfies the relation OP against the dependency version DEP.
Here's the thing β the relation OP is written in Debian syntax no matter which versioning system you're on:
<< strictly earlier
<= earlier or equal
= exactly equal
>= later or equal
>> strictly later
Notice it's << and >>, not < and >. That's not a typo, that's just how Debian rolls. Do not "fix" it, bestie, I'm begging. π
upstream(VER)
Returns the upstream component of the given version string. Just the upstream part. That's the whole job. β¨
π¦ SEE ALSO π¦
The whole friend group, fr fr. π
π AUTHOR π
Brendan O'Dea <bod@debian.org> β the actual legend behind this. Respect. π«Ά
Okay that's the page, we're done here! This little masterpiece is from perl v5.42.3, dated 2026-08-19, and it belongs to the AptPkg::Version(3pm) manual. Go forth and compare versions responsibly πβ¨
π¦ where this page comes from
- ubuntu stonking: libapt-pkg-perl 0.1.43build1 Β· 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