CUPT_FUNCTIONALSELECTORS(7)

πŸ“¦
version 2.10.4 Β· 4 versions
, in ubuntu noble, ubuntu resolute

πŸ’– NAME πŸ’–

cupt_functionselectors β€” the syntax of functional selectors in the cupt package manager. From the Cupt(7) Miscellaneous Information Manual. ✨


🎯 AIM 🎯

Okay so functional selectors are for fine-grained selection of versions. Standard mechanisms already let you select versions by package name, version string and/or distribution, but functional selectors embed a whole microlanguage to select versions by their various properties. It's giving precision. It's giving main character energy. πŸ‘‘


✨ SYNTAX ✨

A Functional selector expression (FSE) consists of function name and list of arguments:

'function_name(argument1, argument2, ... argumentN)'

Every argument can be an FSE itself or a string. Arguments are separated by the comma (,). Additional whitespace characters (space, tab, newline) are allowed β€” and ignored by parser β€” anywhere except between the function name and the opening bracket. So do not try to separate the function name from its opening bracket, bestie, the parser is not here for that. πŸ™ˆ

If the argument is a string and contains commas or round brackets, the argument should be quoted by placing the / character around it (/argument/). Slash-core. πŸŽ€

If the function receives no arguments, arguments bracked may be omitted: function_name is an equivalent to function_name(). (Yes, the page says β€œbracked”. We move. πŸ’€)

The expression argument1 & argument2 & ... & argumentN is a special short form for and(argument1, argument2, ... argumentN). Similarly, the expression argument1 | argument2 | ... | argumentN is a special short form for or(argument1, argument2, ... argumentN). Iconic shorthand behavior. πŸ”₯


πŸ”₯ FUNCTION REFERENCE πŸ”₯

🧠 Logic functions

Receive FSEs as arguments.

  • and(fse1, fse2, ... fseN) β€” argument count: β‰₯ 1. Returns versions which satisfy all of the fse1..fseN. βœ…
  • or(fse1, fse2, ... fseN) β€” argument count: β‰₯ 1. Returns versions which satisfy any of the fse1..fseN. πŸŽ‰
  • not(fse) β€” argument count: 1. Returns versions which don't satisfy fse. 🚫
  • xor(fse1, fse2) β€” argument count: 2. Returns versions which satisfy either fse1 or fse2 but not both. ⚑

πŸ“¦ Package property functions

  • package:name(regex) β€” short alias: Pn. Returns versions which package name matches regex. Notes: β€”. 🌸
  • package:installed() β€” short alias: Pi. Returns versions which belong to to installed packages. Notes: applies only to binary versions. πŸ–₯️
  • package:automatically-installed() β€” short alias: Pai. Returns versions which belong to automatically installed packages. Notes: applies only to binary versions. πŸ€–

🌈 Common version property functions

Apply to source and binary versions. So both sides get the vibe check. πŸ¦‹

  • version(regex) β€” short alias: v. Returns versions which version string matches regex. πŸ”’
  • maintainer(regex) β€” short alias: m. Returns versions which maintainer matches regex. πŸ‘©β€πŸ’»
  • priority(regex) β€” short alias: p. Returns versions which priority matches regex. ⭐
  • section(regex) β€” short alias: s. Returns versions which section matches regex. πŸ“š
  • trusted() β€” short alias: t. Returns versions which come from at least one release with a valid cryptographic signature. πŸ”
  • field(field_name, regex) β€” short alias: f. Returns versions which valueΒΉ of the non-standard (not recognized by Cupt) field field_name matches regex. πŸ“

¹If the version does not contain a field field_name, its value is assumed being empty string; and it can still match if regular expression matches empty string. So empty-string regex energy is valid here. 🫢

Functions from this family receive one string argument (regex) and return versions which come from at least one release where property (see the following table) matches the regular expression regex.

okay so continuing with the release property functions, bestie, here's the whole vibe: πŸ’–

the columns are Function name, Short alias, and Property, and each bullet is giving exactly that:

  • release:archive β€” alias: Ra β€” property: archive
  • release:codename β€” alias: Rn β€” property: codename
  • release:component β€” alias: Rc β€” property: component
  • release:version β€” alias: Rv β€” property: version
  • release:vendor β€” alias: Ro β€” property: vendor
  • release:origin β€” alias: Ru β€” property: origin (base URI)

Binary version property functions ✨

these functions? they apply only to binary versions, no cap. πŸ’…

the columns are Function name and arguments, Short alias, and Returns versions which..., so here's the tea:

  • source-package(regex) β€” alias: sp β€” returns versions which source package matches regex
  • source-version(regex) β€” alias: sv β€” returns versions which source version string matches regex
  • essential() β€” alias: e β€” returns versions which have 'Essential' flag set
  • important() β€” alias: (none) β€” returns versions which have 'Important' flag set
  • installed() β€” alias: i β€” returns versions which are installed in the system
  • description(regex) β€” alias: d β€” returns versions which description matches regex
  • provides(regex) β€” alias: o β€” returns versions which provides at least one virtual package which matches regex

Source version property functions 🌸

these apply only to source versions, bestie. 🫢

  • uploaders(regex) β€” alias: u β€” returns versions which have at least one uploader which matches regex

Binary relation functions πŸ’…

these apply only to binary versions, periodt.

forward dependencies πŸ”₯

Functions from this family receive one FSE-argument (fse) and return all versions which satisfy the dependency of type relation type for fse (see the following table).

so like, each bullet is: Function name, Short alias, Relation type. here we go:

  • pre-depends β€” alias: Ypd β€” relation type: Pre-Depends
  • depends β€” alias: Yd β€” relation type: Depends
  • recommends β€” alias: Yr β€” relation type: Recommends
  • suggests β€” alias: Ys β€” relation type: Suggests
  • enhances β€” alias: Ye β€” relation type: Enhances
  • conflicts β€” alias: Yc β€” relation type: Conflicts
  • breaks β€” alias: Yb β€” relation type: Breaks
  • replaces β€” alias: Yrp β€” relation type: Replaces

reverse dependencies 🌈

Functions from this family receive one FSE-argument (fse) and return all versions for which at least one version from fse satisfies the dependency of type relation type (see the following table).

  • reverse-pre-depends β€” short alias: YRpd, relation type: Pre-Depends πŸ’–
  • reverse-depends β€” short alias: YRd, relation type: Depends ✨
  • reverse-recommends β€” short alias: YRr, relation type: Recommends πŸŽ€
  • reverse-suggests β€” short alias: YRs, relation type: Suggests πŸ¦‹
  • reverse-enhances β€” short alias: YRe, relation type: Enhances 🌸
  • reverse-conflicts β€” short alias: YRc, relation type: Conflicts πŸ’…
  • reverse-breaks β€” short alias: YRb, relation type: Breaks 🫢
  • reverse-replaces β€” short alias: YRrp, relation type: Replaces 😭

Source relation functions 🧚

forward dependencies πŸ’–

Okay so bestie, these ones are giving source versions only β€” they take in source versions and return binary versions. No cap. Every function in this fam gets one FSE-argument (fse) and returns all the versions that satisfy the build-time dependency of type relation type for that fse (the table below spills the tea). πŸ’…

  • build-depends β€” short alias: Zbd, relation type: Build-Depends πŸ”₯
  • build-depends-indep β€” short alias: Zbdi, relation type: Build-Depends-Indep πŸ”₯
  • build-depends-arch β€” short alias: (none), relation type: Build-Depends-Arch πŸ”₯
  • build-conflicts β€” short alias: Zbc, relation type: Build-Conflicts πŸ’€
  • build-conflicts-indep β€” short alias: Zbci, relation type: Build-Conflicts-Indep πŸ’€
  • build-conflicts-arch β€” short alias: (none), relation type: Build-Conflicts-Arch πŸ’€

reverse dependencies πŸ’œ

Now for the reverse glow-up: these apply only to binary versions and return source versions. Fr fr. Every function here also gets one FSE-argument (fse) and returns all the versions for which at least one version from that fse satisfies the build-dependency of type relation type (again, table below has the tea). 🌈

  • reverse-build-depends β€” short alias: ZRbd, relation type: Build-Depends 🌈
  • reverse-build-depends-indep β€” short alias: ZRbdi, relation type: Build-Depends-Indep 🌈
  • reverse-build-depends-arch β€” short alias: (none), relation type: Build-Depends-Arch 🌈
  • reverse-build-conflicts β€” short alias: ZRbc, relation type: Build-Conflicts ⭐
  • reverse-build-conflicts-indep β€” short alias: ZRbci, relation type: Build-Conflicts-Indep ⭐
  • reverse-build-conflicts-arch β€” short alias: (none), relation type: Build-Conflicts-Arch ⭐

Metafunctions πŸ‘‘

defining functions πŸŽ€

The function with defines a user function with no parameters that you can use as an FSE-argument in the subexpression. It's giving custom vibes. Here's the syntax:

with(function_name, function_expression, subexpression)
  • function_name β€” user-defined function name, must start with an underscore (_) πŸ’…
  • function_expression β€” FSE, function value ✨
  • subexpression β€” FSE which the defined function can be used in πŸ¦‹

This function returns the value of subexpression. Periodt. πŸ‘‘

recursing 🧚

The function recursive defines a recursive transformation FSE. Lowkey iconic. Syntax:

recursive(subresult_function_name, initial_subresult, iterating_expression)

These are the args, and they're literally everything you need to know bestie πŸ’–:

  • subresult_function_name β€” a user-defined function name, and no cap it must start with an underscore (_) or it's not valid, periodt
  • initial_subresult β€” an FSE, the starting value of subresult_function_name
  • subexpression β€” an FSE that gets computed on every single recurse iteration, and it's the one subresult_function_name is used in

So here's the whole vibe check of how the function actually runs, step by step ✨:

  1. subresult_function_name defined as initial_subresult
  2. the value of iterating_expression is computed
  3. if this value is equal to subresult_function_name() its returned as function result
  4. subresult_function_name redefined as or(subresult_function_name, iterating_expression)
  5. go to step 2

πŸ—ΊοΈ mapping

The function fmap applies many functions to the same expression and then combines all their results together β€” it's giving group project but actually productive 🫢.

So this expression right here:

fmap(fse, function_name_1, ..., function_name_N)

is literally equivalent to:

or(function_name_1(fse), ..., function_name_N(fse))

πŸŽ€ Miscellaneous

A few extra icon functions that lowkey do the most πŸ’…:

  • best(fse) β€” filters out those versions from fse for which there are another version of the same package and higher pin
  • binary-to-source(binary_fse) β€” converts binary versions, selected by binary_fse, to their corresponding source versions
  • source-to-binary(source_fse) β€” converts source versions, selected by source_fse, to lists of their corresponding binary versions

And that's a wrap on the whole page, bestie πŸ˜­πŸ’– footer check real quick: Eugene V. Lyubimkin holds it down on the left, there's a date stamped in the middle (44date), and it all signs off as Function... in Cupt(7) on the right. Iconic. Go write some selectors, you've got this πŸŒˆπŸ‘‘βœ¨

πŸ“¦ where this page comes from