From edd0452a932e4fb0e063fd3c3aff11826bca6cfe Mon Sep 17 00:00:00 2001
From: André Erdmann Contents An installation of roverlay includes some helper programs: a wrapper around /bin/sh that runs a shell or shell script in roverlay's
+hook environment. roverlay-related scripts can use it to automatically inherit roverlay's
+config and $FUNCTIONS file: <<TODO: maybe there's a better place for the details>> As stated above, each rule has two parts, a match block that lists the
rule's conditions and an action block that defines which actions and
nested rules are applied to a package if the rule matches it, i.e. if all
-conditions are met. A rule file contains zero or more package rules.
-Each rule has to declare one match and one action statement at least.
-The basic syntax for a rule with 1..m match and 1..n action statements is A rule is introduced by the MATCH: keyword, which starts the
match block and is followed by one or more match statements, one per line.
The match block ends with the ACTION: keyword, which also starts the
action block and is followed by one or more action statements
-(again, one per line). Finally, the rule is terminated by the END; keyword. Indention is purely optional, leading and ending whitespace will be discarded.
Lines starting with # or ; are considered to be comments and will be
ignored. The two-arg form of the set/rename keywords expect a <key> as first and
@@ -2190,6 +2250,19 @@ ACTION:
END;
# top-level rule, action block continues
...
+ELSE:
+ # top-level rule, alternative action block
+ ...
+ MATCH:
+ # (alternative) nested rule, match block
+ ...
+ ACTION:
+ # (alternative) nested rule, action block
+ ...
+ ELSE:
+ # (alternative) nested rule, alternative action block
+ ...
+ END;
END;
Rules can be nested indefinitely, whitespace indention is optional.
@@ -2201,13 +2274,19 @@ checks necessary for a given package. A rule that ignores the 'yaqcaffy' package from CRAN, which is also available
-from BIOC: A more complex example that sets the KEYWORDS ebuild variable for
@@ -2219,11 +2298,12 @@ MATCH:
* package_name ~ x86_64
* package_name ~ amd64
ACTION:
- keywords "-x86 amd64"
MATCH:
repo == BIOC/experiment
ACTION:
keywords "-x86 ~amd64"
+ ELSE:
+ keywords "-x86 amd64"
END;
END;
@@ -2258,6 +2338,13 @@ ACTION:
rename_destfile s=^=R-package/=
END;
+ Hint roverlay [--nosync] [--dump-file <file>] apply_rules can be used to
+test rules. It applies the rules to all packages without running overlay
+creation. Furthermore, roverlay --ppr parses the package rules,
+prints them and exits afterwards.
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
@@ -848,6 +854,9 @@ This also tries to recreate the distmap.
--no-incremental
+ Force recreation of existing ebuilds
+--no-revbump
+Disable revbump checks in incremental overlay creation mode
@@ -897,6 +906,9 @@ an overlay that is not suitable for production usage.
--no-write
--immediate-ebuild-writes
Disable overlay writing
+
+--dump-stats
+Print all stats
--show
Print all ebuilds and metadata to console
@@ -956,6 +968,35 @@ to symbolic links if hard links are not supported. This should be fine in
most cases, but fine-tuning can be done via OVERLAY_DISTDIR_STRATEGY and
OVERLAY_DISTDIR_FLAT.
+
3.4 roverlay helpers
+
+
+
+#!/usr/bin/roverlay-sh
+
+# reset DEBUG, VERBOSE, QUIET
+DEBUG=n; QUIET=n; VERBOSE=y
+
+# load the functions file (optional)
+. "${FUNCTIONS?}" || exit
+
+# script body
+true
+
+4 Basic Implementation Overview
@@ -1792,7 +1833,7 @@ as sci-R/zoo. This rule can be written as a single word, zoo.<
Each package rule consists of conditions, e.g. package name contains amd64,
and actions, e.g. set KEYWORDS="-x86 amd64".
The actions of a rule will only be applied if a package meets all conditions,
-otherwise the rule does nothing.
+otherwise the rule applies alternative actions (if defined) or does nothing.
Moreover, rules can contain further rules which will only take effect if all
enclosing rules match a given package.
MATCH:
<match statement 1>
@@ -1815,13 +1859,20 @@ ACTION:
<action statement 2>
...
<action statement n>
+ELSE:
+ <alternative action statement 1>
+ <alternative action statement 2>
+ ...
+ <alternative action statement k>
END;
+rename_<key>
1
+null
+n/a
+none
+does nothing
+(can be used for
+readability)
+pass
+8.1.3 Package Rule Examples
MATCH:
- repo == CRAN
- package_name == yaqcaffy
+ repo CRAN
ACTION:
- do-not-process
+ MATCH:
+ package_name == yaqcaffy
+ ACTION:
+ do-not-process
+ ELSE:
+ set category sci-CRAN
+ END;
END;
initial working directory
+depends on $ROVERLAY_PHASE (usually set +to $OVERLAY or left unchanged)
+Shell function files should be put into <ADDITIONS_DIR>/shlib.
+The following table lists all known events (ROVERLAY_PHASE):
+name | +initial working directory | +description | +
---|---|---|
overlay_success | +$OVERLAY | +overlay creation succeeded | +
db_written | +$OVERLAY | +stats database file written | +
user | +unchanged | +user-triggered event | +
Adding a new event has to be done in roverlay's source code and is a rather trivial task. The roverlay.hook module implements a function for running the event script:
@@ -2940,6 +3101,13 @@ writing.A list of repo names that are used as 'masters' attribute when generating +<overlay>/metadata/layout.conf.
+Defaults to "gentoo".
+Sets the name of the created overlay that will be written into @@ -3277,9 +3445,9 @@ as flag.
<<section is TODO>>
+<<links to depres console chapter may need to be fixed>>
+<<basic commands, table>>
+<<note regarding python -OO and missing help texts>>
Warning
+This section is out-of-date.
+As previously stated, the DepRes Console is only meant for testing. It is an interactive console with the following features:
Running roverlay depres_console will print a welcome message that lists all available commands and a few usage hints.
For reference, these commands are currently available:
+<<TODO: rewrite/update command table, it's out-of-date>>
help, -h | +h, ?lists all commands | |
help --list, -h --list | -lists all help topics for which help is available | -|
help <cmd>, h <cmd> | prints a command-specific help message | @@ -3404,65 +3583,78 @@ lcloads the rule files listed in the config file into a new rule pool |
addrule <rule> + | ||
add_rule <rule> + <rule> | creates a new rule and adds it to the topmost, i.e. latest rule pool. This command uses -Rule File Syntax, but multi line rules are -not supported. | +Rule File Syntax. Multi line rules are +supported.|
add_pool, << | creates a new rule pool | |
unwind, + | ||
unwind_pool, >> | removes the topmost rule pool and all of its rules | |
resolve <dep>, -? <dep> | +?? <dep>tries to resolve the given dependency string and prints the result | |
! | +enter the resolve command chroot +all input will be prefixed with "resolve" | +|
!! | +leave any command chroot | +|
print, p | prints the rules of the topmost rule pool | |
print all, p all | +||
print --all|-a | prints the rules of all rule pools | |
print <id> [<id>..] | +prints the rules of a specific rule pool | +|
write <file>, w <file> | writes the rules of the topmost rule pool into -<file> | +<file>. See write --help for advanced usage.|
cd <dir> | -changes the working directory, also creates it if -necessary | +changes the working directory +This is a virtual command. <<TODO:EXPLAIN>> | +
set VAR=VALUE | +set variables | |
scandir <dir>, -sd <dir> | -creates dependency rules for each R package found -in <dir> | +|
unset VAR | +unset variables | |
set, unset | -prints the status of currently (in)active modes | +|
declare | +show declared variables | |
set <mode>, -unset <mode> | -sets or unsets <mode>. There is only one mode to -control, the shlex mode which controls how -command arguments are parsed | +|
alias | +show command aliases | |
mkhelp | -verifies that each accessible command has a help -message | +|
unalias | +reserved for future usage | |
exit, qq, q | exits the DepRes Console |
Note
+Some commands also offer more detailed help via <command> --help.
+<<TODO>>
+<<Example Session is out-of-date>>
@@ -3512,6 +3704,7 @@ cmd % exit
Roverlay provides an API for accessing its functionality independently of @@ -3547,6 +3740,10 @@ initialization
For extending the API, roverlay provides the abstract RoverlayInterface and @@ -3572,9 +3769,13 @@ and cannot_resolve() also possible
Refer to in-code documentation on how to use this interface. -See the dependency resolution test suite for a usage example -(tests.depres, not part of the roverlay installation). -(The depres console is also a candidate for using this interface in future.)
+See the dependency resolution test suite (tests.depres, not part of the +roverlay installation) and the dependency resolution console +for usage examples. + +<<TODO; this interface isn't mature enough yet (it will likely change in future)>>