CUPT_FUNCTIONALSELECTORS(7)
π 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 thefse1..fseN. βor(fse1, fse2, ... fseN)β argument count:β₯ 1. Returns versions which satisfy any of thefse1..fseN. πnot(fse)β argument count:1. Returns versions which don't satisfyfse. π«xor(fse1, fse2)β argument count:2. Returns versions which satisfy eitherfse1orfse2but not both. β‘
π¦ Package property functions
package:name(regex)β short alias:Pn. Returns versions which package name matchesregex. 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 matchesregex. π’maintainer(regex)β short alias:m. Returns versions which maintainer matchesregex. π©βπ»priority(regex)β short alias:p. Returns versions which priority matchesregex. βsection(regex)β short alias:s. Returns versions which section matchesregex. π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) fieldfield_namematchesregex. π
ΒΉ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. π«Ά
π release-related functions π
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:archiverelease:codenameβ alias:Rnβ property:codenamerelease:componentβ alias:Rcβ property:componentrelease:versionβ alias:Rvβ property:versionrelease:vendorβ alias:Roβ property:vendorrelease: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 matchesregexsource-version(regex)β alias:svβ returns versions which source version string matchesregexessential()β alias:eβ returns versions which have'Essential'flag setimportant()β alias: (none) β returns versions which have'Important'flag setinstalled()β alias:iβ returns versions which are installed in the systemdescription(regex)β alias:dβ returns versions which description matchesregexprovides(regex)β alias:oβ returns versions which provides at least one virtual package which matchesregex
Source version property functions πΈ
these apply only to source versions, bestie. π«Ά
uploaders(regex)β alias:uβ returns versions which have at least one uploader which matchesregex
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-Dependsdependsβ alias:Ydβ relation type:Dependsrecommendsβ alias:Yrβ relation type:Recommendssuggestsβ alias:Ysβ relation type:Suggestsenhancesβ alias:Yeβ relation type:Enhancesconflictsβ alias:Ycβ relation type:Conflictsbreaksβ alias:Ybβ relation type:Breaksreplacesβ 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, periodtinitial_subresultβ an FSE, the starting value ofsubresult_function_namesubexpressionβ an FSE that gets computed on every single recurse iteration, and it's the onesubresult_function_nameis used in
So here's the whole vibe check of how the function actually runs, step by step β¨:
subresult_function_namedefined asinitial_subresult- the value of
iterating_expressionis computed - if this value is equal to
subresult_function_name()its returned as function result subresult_function_nameredefined asor(subresult_function_name, iterating_expression)- 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 fromfsefor which there are another version of the same package and higher pinbinary-to-source(binary_fse)β converts binary versions, selected bybinary_fse, to their corresponding source versionssource-to-binary(source_fse)β converts source versions, selected bysource_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
- ubuntu noble: cupt 2.10.4+nmu2build2
- ubuntu resolute: cupt 2.10.4+nmu2build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms