ALPM-COMPARISON(7)

πŸ“¦ version 0.13.0, in arch rolling

✨ NAME ✨

comparison β€” the comparison statements for ALPM based packages, bestie. it's giving "how do i say this package needs to be at least this version" energy πŸ’…


🌸 DESCRIPTION 🌸

okay so. the comparison format is a version comparison format, and what that means is it's the lil language we use to write down version comparison statements for ALPM based packages inside a bigger thing called a composite comparison expression. literally everywhere. you'll see this format in build scripts or in file formats for package metadata (think PKGBUILD or PKGINFO) whenever something needs to describe version bounds for a package relation. no cap πŸ”₯

a comparison statement uses one of these comparison operators to say what the version bound relation is:

  • < (less than)
  • <= (less than or equal to)
  • = (equal to)
  • >= (greater than or equal to)
  • > (greater than)

πŸ¦‹ Composite comparison expressions πŸ¦‹

so a composite comparison expression is just three things glued together with zero spaces, in this exact order:

  • an alpm-package-name
  • directly followed by a comparison operator
  • directly followed by an alpm-package-version

that's it. that's the whole vibe. it's giving "no breathing room, we're efficient here" ✨

πŸ’– Matching comparison expressions πŸ’–

Name matching is a full string match, using the alpm-package-name component of the composite comparison expression. like, exact. no fuzzy wuzzy πŸŽ€

Version comparison works off the components of a composite version string (see e.g. alpm-epoch, alpm-pkgver and alpm-pkgrel). and because alpm-package-version offers several forms, you can match a whole variety of scenarios. iconic, honestly πŸ‘‘

  • when you provide the full or full with epoch form of the alpm-package-version format, it matches exactly one specific release of a package version 🎯
  • when you provide the minimal or minimal with epoch form of the alpm-package-version format, it matches any release of a package version 🌈

and depending on which comparison operator you picked, the match towards alpm-package-name and alpm-package-version is one of three flavours:

  • narrow β€” i.e. =
  • wide with lower bound β€” i.e. >, >=
  • wide with upper bound β€” i.e. <, <=

periodt. πŸ’…


πŸ”₯ EXAMPLES πŸ”₯

these composite comparison expressions below can be matched by a package named example in specific versions. watch this:

"example<1.0.0"

A version less than β€˜1.0.0’ (e.g. β€˜0.8.0-1’).

"example<=1.0.0"

A version less than or equal to β€˜1.0.0’ (e.g. β€˜0.8.0-1’ or β€˜1.0.0-3’).

"example<=1.0.0-1"

A version less than or equal to β€˜1.0.0-1’ (e.g. β€˜0.8.0-1’ or β€˜1.0.0-1’, but β€˜1.0.0-2’ does not work).

"example=1.0.0"

Any version β€˜1.0.0’ (e.g. β€˜1.0.0-1’ or β€˜1.0.0-2’, etc.).

"example=1.0.0-1"

The version β€˜1.0.0-1’.

"example=1:1.0.0-1"

The version β€˜1:1.0.0-1’.

"example>=1.0.0"

A version greater than or equal to β€˜1.0.0’ (e.g. β€˜1.0.0-1’ or β€˜1.1.0-1’).

"example>1.0.0"

A version greater than β€˜1.0.0’ (e.g. β€˜1.1.0-1’ or β€˜1:1.0.0-1’).

ngl the <=1.0.0-1 one is my fave because β€˜1.0.0-2’ does not work and that lil detail is the whole personality of the example 😭

🫢 SEE ALSO 🫢

BUILDINFO(5), PKGBUILD(5), PKGINFO(5), alpm-epoch(7), alpm-package-name(7), alpm-package-relation(7), alpm-package-version(7), alpm-pkgrel(7), alpm-pkgver(7), vercmp(8)

go read those too, they're all part of the same friend group πŸ’œ


okay that's the whole page!! this one lives in section 7 of the Miscellaneous Information Manual, and yeah the footer is just that lone (7) β€” she's lowkey minimal, we love her for it πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from