aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/package_rules191
1 files changed, 21 insertions, 170 deletions
diff --git a/config/package_rules b/config/package_rules
index 560d4d0..ee56bf2 100644
--- a/config/package_rules
+++ b/config/package_rules
@@ -1,190 +1,41 @@
-# roverlay package rules reference
+# package rules file
#
-# !!! draft / todo
+# This file lists a few examples.
+# Refer to "Package Rules" in the usage guide (doc/rst/usage.rst or
+# doc/html/usage.html).
#
-# (Concrete examples: scroll down)
#
-#
-# ========================
-# Package Rule File Syntax
-# ========================
-#
-# Each rule consists of a match- and an action block
-#
-# The basic syntax is <<<
+# set KEYWORDS to "-x86 amd64" for all packages from CRAN that have "x86_64"
+# or "amd64" in their name
#
# MATCH:
-# <match statement 1>
-# <match statement 2>
-# ...
-# <match statement n>
+# repo == CRAN
+# or
+# * package ~ x86_64
+# * package ~ amd64
# ACTION:
-# <action statement 1>
-# <action statement 2>
-# ...
-# <action statement n>
+# keywords "-x86 amd64"
# END;
#
-# >>>
-#
-# As usual, leading whitespace is optional and will be ignored.
-#
-# ------------
-# Match blocks
-# ------------
-#
-# A match block consists of one or more conditions ("match statements")
-# under which a rule applies its actions to a package.
-# It can also contain nested blocks representing a boolean function
-# (AND, OR, NOR, XOR1; syntax: see below)
-# Such "boolean blocks" will _not_ be optimized, so (as usual) be careful
-# with adding unnecessary blocks.
-# The top-level logic for a match block is AND.
-#
-# << copy-paste from roverlay/packagerules/abstract/acceptors.py >>
-# Note:
-# There's no Acceptor_NOT class.
-# How would you define a multi-input function "not :: [Acceptor] -> Bool"?
-# In most cases, you want "none of the listed Acceptors should match",
-# which is exactly the definition of Acceptor_NOR.
-# << end c-p >>
-#
-# Match statement syntax
-# ----------------------
-#
-# Nested match statements / boolean blocks:
-#
-# <boolean function>
-# * <match statement 1>
-# * <match statement 2>
-# * ...
-# * <match statement n>
-#
-# The leading asterisk chars '*' are important and indicate the match depth.
-# For a match depth > 1 they have to be combined into a single string, e.g.
-# "**" for a match depth of 2.
-# As an alternative to the asterisk char, dash chars '-' can also be used
-# (they're interchangeable).
-#
-# A less abstract example that realizes
-#
-# f :: (<match statement>^4) -> <match statement>
-# f (a,b,c,d) := XOR1 ( c, OR ( a, b, AND ( c, d ) ), NOR ( a, d ), b )
-#
-# is <<<
-#
-# xor1
-# * c
-# * or
-# ** a
-# ** b
-# ** and
-# *** c
-# *** d
-# ** nor
-# *** a
-# *** d
-# * b
-#
-# >>>
#
-# boolean expressions: keywords
-#
-# +======+===============+
-# | func | keywords |
-# +======+===============+
-# | AND | and, all, && |
-# +------+---------------+
-# | OR | or, || |
-# +------+---------------+
-# | XOR1 | xor1, xor, ^^ |
-# +------+---------------+
-# | NOR | nor, none |
-# +------+---------------+
-#
-# * these keywords are case sensitive
-#
-#
-# "normal" match statements:
-#
-# A normal match statement consists of a keyword, an operator (optional) and
-# a value ("argv for the keyword").
-#
-# +===============+=============+====================================+
-# | operator name | operator(s) | description |
-# +===============+=============+====================================+
-# | exact-string | == = | exact string match |
-# +---------------+-------------+------------------------------------+
-# | nocase-string | ,= =, | case-insensitive string match |
-# +---------------+-------------+------------------------------------+
-# | exact-regex | ~= =~ | exact regex match (^<expression>$) |
-# +---------------+-------------+------------------------------------+
-# | regex | ~~ ~ | partial regex match |
-# +---------------+-------------+------------------------------------+
-#
-#
-# +==============+==================+================================+
-# | keyword | default operator | description |
-# +==============+==================+================================+
-# | repo | nocase-string | alias to repo_name |
-# +--------------+------------------+--------------------------------+
-# | repo_name | nocase-string | name of the repo, e.g. 'CRAN' |
-# +--------------+------------------+--------------------------------+
-# | package | implicit | package name + version |
-# +--------------+------------------+--------------------------------+
-# | package_name | implicit | the package name (package file |
-# | | | name without version and file |
-# | | | extension) |
-# +--------------+------------------+--------------------------------+
-# | name | implicit | alias to package_name |
-# +--------------+------------------+--------------------------------+
-#
-# implicit operator: exact-regex if any wildcard char ('?','*') in string
-# else exact-string (wildcards will be replaced when
-# using the implicit op.)
-#
-#
-# -------------
-# Action blocks
-# -------------
-#
-# action keywords
-# +================+============+==========================+
-# | keyword | has value? | description |
-# +================+============+==========================+
-# | ignore | no | ignore package |
-# +----------------+------------+--------------------------+
-# | do-not-process | no | ignore package |
-# +----------------+------------+--------------------------+
-# | keywords | yes | set per-package KEYWORDS |
-# +----------------+------------+--------------------------+
-#
-# TODO;
-#
-#
-# ========
-# Examples
-# ========
-#
-# ignore all packages starting with R <<<
+# move packages from CRAN and its archive to the sci-CRAN category
+# and prefix their source files with "cran_"
#
# MATCH:
-# package_name R*
+# or
+# * repo CRAN
+# * repo CRAN-Archive
# ACTION:
-# ignore
+# set category sci-CRAN
+# rename destfile s/^/cran_/
# END;
#
-# >>>
#
-# set KEYWORDS to "-x86 amd64" for all packages from CRAN that have "x86_64"
-# or "amd64" in their name
+# move packages from the bioc repos (BIOC/*) to the sci-BIOC category
#
# MATCH:
-# repo == CRAN
-# or
-# * package ~ x86_64
-# * package ~ amd64
+# repo ~ ^BIOC
# ACTION:
-# keywords "-x86 amd64"
+# set category sci-BIOC
# END;
#