.TH "Functional selectors in Cupt" 7 "%%date" "Eugene V. Lyubimkin" .P .SH NAME .P cupt_functionselectors \- syntax of functional selectors in cupt package manager .SH AIM .P Functional selectors are used for fine\-grained selection of versions. While standard mechanisms provide a way to select versions by package name, version string and/or distribution, functional selectors embed a microlanguage to select versions by their various properties. .SH SYNTAX .P Functional selector expression (FSE) consists of \fBfunction name\fR and \fBlist of arguments\fR: .P \&'\fIfunction_name\fR(\fIargument1\fR, \fIargument2\fR, ... \fIargumentN\fR)' .P Every argument can be a 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. .P If the argument is a string and contains commas or round brackets, the argument should be quoted by placing the / character around it ('/\fIargument\fR/'). .P If the function receives no arguments, arguments bracked may be omitted: \&'\fIfunction_name\fR' is an equivalent to '\fIfunction_name\fR()'. .P The expression '\fIargument1\fR & \fIargument2\fR & ... & \fIargumentN\fR' is a special short form for 'and(\fIargument1\fR, \fIargument2\fR, ... \fIargumentN\fR)'. Similarly, the expression '\fIargument1\fR | \fIargument2\fR | ... | \fIargumentN\fR' is a special short form for 'or(\fIargument1\fR, \fIargument2\fR, ... \fIargumentN\fR)' .SH FUNCTION REFERENCE .SS Logic functions .P Receive FSEs as arguments. .TS allbox, tab(^); lll. \fBFunction name and arguments\fR^\fBArgument count\fR^\fBReturns versions which...\fR and(\fIfse1\fR, \fIfse2\fR, ... \fIfseN\fR)^≥ 1^satisfy all of the \fIfse1\fR..\fIfseN\fR or(\fIfse1\fR, \fIfse2\fR, ... \fIfseN\fR)^≥ 1^satisfy any of the \fIfse1\fR..\fIfseN\fR not(\fIfse\fR)^1^don't satisfy \fIfse\fR xor(\fIfse1\fR, \fIfse2\fR)^2^satisfy either \fIfse1\fR or \fIfse2\fR but not both .TE .SS Package property functions .TS allbox, tab(^); llll. \fBFunction name and arguments\fR^\fBShort alias\fR^\fBReturns versions which...\fR^\fBNotes\fR package:name(\fIregex\fR)^Pn^package name matches \fIregex\fR package:installed()^Pi^belong to to installed packages^applies only to binary versions package:automatically\-installed()^Pai^belong to automatically installed packages^applies only to binary versions .TE .SS Common version property functions .P Apply to source and binary versions. .TS allbox, tab(^); lll. \fBFunction name and arguments\fR^\fBShort alias\fR^\fBReturns versions which...\fR version(\fIregex\fR)^v^version string matches \fIregex\fR maintainer(\fIregex\fR)^m^maintainer matches \fIregex\fR priority(\fIregex\fR)^p^priority matches \fIregex\fR section(\fIregex\fR)^s^section matches \fIregex\fR trusted()^t^come from at least one release with a valid cryptographic signature field(\fIfield_name\fR, \fIregex\fR)^f^value¹ of the non\-standard (not recognized by Cupt) field \fIfield_name\fR matches \fIregex\fR .TE .P ¹If the version does not contain a field \fIfield_name\fR, its value is assumed being empty string; and it can still match if regular expression matches empty string. .SS release-related functions .P Functions from this family receive one string argument (\fIregex\fR) and return versions which come from at least one release where \fIproperty\fR (see the following table) matches the regular expression \fIregex\fR. .TS allbox, tab(^); lll. \fBFunction name\fR^\fBShort alias\fR^\fB\fIProperty\fR\fR release:archive^Ra^archive release:codename^Rn^codename release:component^Rc^component release:version^Rv^version release:vendor^Ro^vendor release:origin^Ru^origin (base URI) .TE .SS Binary version property functions .P Apply only to binary versions. .TS allbox, tab(^); lll. \fBFunction name and arguments\fR^\fBShort alias\fR^\fBReturns versions which...\fR source\-package(\fIregex\fR)^sp^source package matches \fIregex\fR source\-version(\fIregex\fR)^sv^source version string matches \fIregex\fR essential()^e^have 'Essential' flag set important()^^have 'Important' flag set installed()^i^are installed in the system description(\fIregex\fR)^d^description matches \fIregex\fR provides(\fIregex\fR)^o^provides at least one virtual package which matches \fIregex\fR .TE .SS Source version property functions .P Apply only to source versions. .TS allbox, tab(^); lll. \fBFunction name and arguments\fR^\fBShort alias\fR^\fBReturns versions which...\fR uploaders(\fIregex\fR)^u^have at least one uploader which matches \fIregex\fR .TE .SS Binary relation functions .P Apply only to binary versions. .SS forward dependencies .P Functions from this family receive one FSE\-argument (\fIfse\fR) and return all versions which satisfy the dependency of type \fIrelation type\fR for \fIfse\fR (see the following table). .TS allbox, tab(^); lll. \fBFunction name\fR^\fBShort alias\fR^\fB\fIRelation type\fR\fR pre\-depends^Ypd^Pre\-Depends depends^Yd^Depends recommends^Yr^Recommends suggests^Ys^Suggests enhances^Ye^Enhances conflicts^Yc^Conflicts breaks^Yb^Breaks replaces^Yrp^Replaces .TE .SS reverse dependencies .P Functions from this family receive one FSE\-argument (\fIfse\fR) and return all versions for which at least one version from \fIfse\fR satisfies the dependency of type \fIrelation type\fR (see the following table). .TS allbox, tab(^); lll. \fBFunction name\fR^\fBShort alias\fR^\fB\fIRelation type\fR\fR reverse\-pre\-depends^YRpd^Pre\-Depends reverse\-depends^YRd^Depends reverse\-recommends^YRr^Recommends reverse\-suggests^YRs^Suggests reverse\-enhances^YRe^Enhances reverse\-conflicts^YRc^Conflicts reverse\-breaks^YRb^Breaks reverse\-replaces^YRrp^Replaces .TE .SS Source relation functions .SS forward dependencies .P Apply only to source versions and return binary versions. .P Functions from this family receive one FSE\-argument (\fIfse\fR) and return all versions which satisfy the build\-time dependency of type \fIrelation type\fR for \fIfse\fR (see the following table). .TS allbox, tab(^); lll. \fBFunction name\fR^\fBShort alias\fR^\fB\fIRelation type\fR\fR build\-depends^Zbd^Build\-Depends build\-depends\-indep^Zbdi^Build\-Depends\-Indep build\-depends\-arch^^Build\-Depends\-Arch build\-conflicts^Zbc^Build\-Conflicts build\-conflicts\-indep^Zbci^Build\-Conflicts\-Indep build\-conflicts\-arch^^Build\-Conflicts\-Arch .TE .SS reverse dependencies .P Apply only to binary versions and return source versions. .P Functions from this family receive one FSE\-argument (\fIfse\fR) and return all versions for which at least one version from \fIfse\fR satisfies the build\-dependency of type \fIrelation type\fR (see the following table). .TS allbox, tab(^); lll. \fBFunction name\fR^\fBShort alias\fR^\fB\fIRelation type\fR\fR reverse\-build\-depends^ZRbd^Build\-Depends reverse\-build\-depends\-indep^ZRbdi^Build\-Depends\-Indep reverse\-build\-depends\-arch^^Build\-Depends\-Arch reverse\-build\-conflicts^ZRbc^Build\-Conflicts reverse\-build\-conflicts\-indep^ZRbci^Build\-Conflicts\-Indep reverse\-build\-conflicts\-arch^^Build\-Conflicts\-Arch .TE .SS Metafunctions .SS defining functions .P The function \fBwith\fR defines a user function with no parameters which can be used as FSE\-argument in the subexpression. .P Syntax: .P with(\fIfunction_name\fR, \fIfunction_expression\fR, \fIsubexpression\fR) .TS allbox, tab(^); ll. \fBArgument\fR^\fBMeaning\fR \fIfunction_name\fR^user\-defined function name, must start with an underscore (_) \fIfunction_expression\fR^FSE, function value \fIsubexpression\fR^FSE which the defined function can be used in .TE .P This function returns the value of \fIsubexpression\fR. .SS recursing .P The function \fBrecursive\fR defines a recursive transformation FSE. .P Syntax: .P recursive(\fIsubresult_function_name\fR, \fIinitial_subresult\fR, \fIiterating_expression\fR) .TS allbox, tab(^); ll. \fBArgument\fR^\fBMeaning\fR \fIsubresult_function_name\fR^user\-defined function name, must start with an underscore (_) \fIinitial_subresult\fR^FSE, initial value of \fIsubresult_function_name\fR \fIsubexpression\fR^FSE to compute on each recurse iteration, which \fIsubresult_function_name\fR to be used in .TE .P The function works as follows: .RS .IP 1. 3 \fIsubresult_function_name\fR defined as \fIinitial_subresult\fR .IP 2. 3 the value of \fIiterating_expression\fR is computed .IP 3. 3 if this value is equal to \fIsubresult_function_name()\fR its returned as function result .IP 4. 3 \fIsubresult_function_name\fR redefined as or(\fIsubresult_function_name\fR, \fIiterating_expression\fR) .IP 5. 3 go to step 2 .RE .IP .SS mapping .P The function \fBfmap\fR applies many functions to the same expression and combines their results. .P The expression .P fmap(\fIfse\fR, \fIfunction_name_1\fR, ..., \fIfunction_name_N\fR) .P is equivalent to .P or(\fIfunction_name_1\fR(\fIfse\fR), ..., \fIfunction_name_N\fR(\fIfse\fR)) .SS Miscellaneous .TS allbox, tab(^); ll. \fBFunction name and arguments\fR^\fBValue\fR best(\fIfse\fR)^filters out those versions from \fIfse\fR for which there are another version of the same package and higher pin binary\-to\-source(\fIbinary_fse\fR)^converts binary versions, selected by \fIbinary_fse\fR, to their corresponding source versions source\-to\-binary(\fIsource_fse\fR)^converts source versions, selected by \fIsource_fse\fR, to lists of their corresponding binary versions .TE .\" man code generated by txt2tags 3.4 (http://txt2tags.org) .\" cmdline: txt2tags -t man -o cupt_functionalselectors.7 /build/reproducible-path/cupt-2.10.4+nmu1+b2/doc/functionalselectors.t2t