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