[Pkg-gnupg-commit] [gnupg2] 103/160: doc: Describe filter expressions.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 15 09:36:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch upstream
in repository gnupg2.

commit 442efa9b3ff211c692b6967a944b3d9371ad1bb7
Author: Werner Koch <wk at gnupg.org>
Date:   Sat Jul 2 16:18:50 2016 +0200

    doc: Describe filter expressions.
    
    * doc/gpg.texi: Remove some superfluous .E.
    (FILTER EXPRESSIONS): New.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 common/recsel.c |   6 +--
 doc/gpg.texi    | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 124 insertions(+), 9 deletions(-)

diff --git a/common/recsel.c b/common/recsel.c
index b35574f..5dc685f 100644
--- a/common/recsel.c
+++ b/common/recsel.c
@@ -133,7 +133,7 @@ find_next_lc (char *string)
 }
 
 
-/* Parse an expression.  The expression symtax is:
+/* Parse an expression.  The expression syntax is:
  *
  *   [<lc>] {{<flag>} PROPNAME <op> VALUE [<lc>]}
  *
@@ -161,8 +161,8 @@ find_next_lc (char *string)
  *   >=  The numerical value of the field must be GE than the value.
  *   -n  True if value is not empty (no VALUE parameter allowed).
  *   -z  True if value is empty (no VALUE parameter allowed).
- *   -t  Alias for "NAME != 0" (no VALUE parameter allowed).
- *   -f  Alias for "NAME == 0" (no VALUE parameter allowed).
+ *   -t  Alias for "PROPNAME != 0" (no VALUE parameter allowed).
+ *   -f  Alias for "PROPNAME == 0" (no VALUE parameter allowed).
  *
  * Values for <flag> must be space separated and any of:
  *
diff --git a/doc/gpg.texi b/doc/gpg.texi
index 7118e0d..7dff333 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -570,7 +570,7 @@ Use the source, Luke :-). The output format is still subject to change.
 
 
 @item --enarmor
- at item --dearmor
+ at itemx --dearmor
 @opindex enarmor
 @opindex dearmor
 Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
@@ -2239,9 +2239,9 @@ The available filter types are:
 
 @end table
 
-The syntax for the expression is defined in the appendix (FIXME).  The
-property names for the expressions depend on the actual filter type
-and are indicated in the following table.
+For the syntax of the expression see the chapter "FILTER EXPRESSIONS".
+The property names for the expressions depend on the actual filter
+type and are indicated in the following table.
 
 The available properties are:
 
@@ -3238,7 +3238,6 @@ current home directory (@pxref{option --homedir}).
 
 @end table
 
- at c man:.RE
 Note that on larger installations, it is useful to put predefined files
 into the directory @file{@value{SYSCONFSKELDIR}} so that
 newly created users start up with a working configuration.
@@ -3313,7 +3312,6 @@ files; They all live in in the current home directory (@pxref{option
 
 @end table
 
- at c man:.RE
 Operation is further controlled by a few environment variables:
 
 @table @asis
@@ -3406,6 +3404,123 @@ user for the filename.
 @include specify-user-id.texi
 @end ifset
 
+ at mansect filter expressions
+ at chapheading FILTER EXPRESSIONS
+
+The options @option{--import-filter} and @option{--export-filter} use
+expressions with this syntax (square brackets indicate an optional
+part and curly braces a repetition, white space between the elements
+are allowed):
+
+ at c man:.RS
+ at example
+  [lc] @{[@{flag@}] PROPNAME op VALUE [lc]@}
+ at end example
+ at c man:.RE
+
+The name of a property (@var{PROPNAME}) may only consist of letters,
+digits and underscores.  The description for the filter type
+describes which properties are defined.  If an undefined property is
+used it evaluates to the empty string.  Unless otherwise noted, the
+ at var{VALUE} must always be given and may not be the empty string.  No
+quoting is defined for the value, thus the value may not contain the
+strings @code{&&} or @code{||}, which are used as logical connection
+operators.  The flag @code{--} can be used to remove this restriction.
+
+Numerical values are computed as long int; standard C notation
+applies.  @var{lc} is the logical connection operator; either
+ at code{&&} for a conjunction or @code{||} for a disjunction.  A
+conjunction is assumed at the begin of an expression.  Conjunctions
+have higher precedence than disjunctions.  If @var{VALUE} starts with
+one of the characters used in any @var{op} a space after the
+ at var{op} is required.
+
+ at noindent
+The supported operators (@var{op}) are:
+
+ at table @asis
+
+  @item =~
+  Substring must match.
+
+  @item  !~
+  Substring must not match.
+
+  @item  =
+  The full string must match.
+
+  @item  <>
+  The full string must not match.
+
+  @item  ==
+  The numerical value must match.
+
+  @item  !=
+  The numerical value must not match.
+
+  @item  <=
+  The numerical value of the field must be LE than the value.
+
+  @item  <
+  The numerical value of the field must be LT than the value.
+
+  @item  >=
+  The numerical value of the field must be GT than the value.
+
+  @item  >=
+  The numerical value of the field must be GE than the value.
+
+  @item  -n
+  True if value is not empty (no value allowed).
+
+  @item  -z
+  True if value is empty (no value allowed).
+
+  @item  -t
+  Alias for "PROPNAME != 0" (no value allowed).
+
+  @item  -f
+  Alias for "PROPNAME == 0" (no value allowed).
+
+ at end table
+
+ at noindent
+Values for @var{flag} must be space separated.  The supported flags
+are:
+
+ at table @asis
+  @item --
+  @var{VALUE} spans to the end of the expression.
+  @item -c
+  The string match in this part is done case-sensitive.
+ at end table
+
+The filter options concatenate several specifications for a filter of
+the same type.  For example the four options in this example:
+
+ at c man:.RS
+ at example
+ --import-option keep-uid="uid =~ Alfa"
+ --import-option keep-uid="&& uid !~ Test"
+ --import-option keep-uid="|| uid =~ Alpha"
+ --import-option keep-uid="uid !~ Test"
+ at end example
+ at c man:.RE
+
+ at noindent
+which is equivalent to
+
+ at c man:.RS
+ at example
+ --import-option \
+  keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
+ at end example
+ at c man:.RE
+
+imports only the user ids of a key containing the strings "Alfa"
+or "Alpha" but not the string "test".
+
+
 @mansect return value
 @chapheading RETURN VALUE
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list