public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: doc/rst/
Date: Wed,  7 Aug 2013 16:10:12 +0000 (UTC)	[thread overview]
Message-ID: <1375890859.a7bdfc6904b64fae37e9b8a18134f07a9c55f0c6.dywi@gentoo> (raw)

commit:     a7bdfc6904b64fae37e9b8a18134f07a9c55f0c6
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Aug  7 15:54:19 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Aug  7 15:54:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a7bdfc69

doc/rst: license map syntax, using roverlay's API

+ documentation about ebuild variable protection features

---
 doc/rst/usage.rst | 148 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 133 insertions(+), 15 deletions(-)

diff --git a/doc/rst/usage.rst b/doc/rst/usage.rst
index 2da8dd0..88761e5 100644
--- a/doc/rst/usage.rst
+++ b/doc/rst/usage.rst
@@ -52,20 +52,28 @@ This document is targeted at
    * *roverlay* maintainers who **control and test overlay creation**,
      e.g. configure which R packages will be part of the generated overlay
 
-     Depending on what you want to configure, chapters 5-10 are relevant,
+     Depending on what you want to configure, chapters 5-11 are relevant,
      namely `Repositories / Getting Packages`_, `Additions Directory`,
      `Dependency Rules`_, `Package Rules`_, `Configuration Reference`_
      and `Field Definition Config`_.
 
      There is another chapter that is only interesting for testing, the
-     `Dependency Resolution Console`_ (11), which can be used to interactively
-     test dependency rules.
+     `Dependency Resolution Console`_ (12.1), which can be used to
+     interactively test dependency rules.
+
 
    * *roverlay* code maintainers who want to know **how roverlay works** for
      code improvements etc.
 
-     The most important chapter is `Implementation Overview`_ (12) which has
-     references to other chapters (4-10) where required.
+     The most important chapter is `Implementation Overview`_ (14) which has
+     references to other chapters (4-13) where required.
+
+   * developers who intend to **use roverlay's functionality outside of roverlay**
+
+     The most important chapter is `Roverlay Interface`_, which gives an
+     overview of *roverlay's* API.
+     Reading the other chapters (4-14) is recommended.
+
 
 Expected prior knowlegde:
 
@@ -197,17 +205,15 @@ as the *R Overlay src directory* from now on.
 ------------------------------
 
 *roverlay* needs a configuration file to run.
-If roverlay has been installed with *emerge*, it will look for the config file in
-that order:
+If roverlay has been installed with *emerge*,
+it will look for the config file in that order:
 
-1. *<current directory>/R-overlay.conf*
 #. *~/roverlay/R-overlay.conf*
 #. */etc/roverlay/R-overlay.conf*,
    which is part of the installation but has to be modified.
 
-Otherwise, *roverlay* will only look for *R-overlay.conf* in the current
-directory. An example config file is available in the
-*R Overlay src directory*.
+Otherwise, *roverlay* uses *R-overlay.conf* in the current directory.
+An example config file is available in the *R Overlay src directory*.
 
 The config file is a text file with '<option> = <value>' syntax. Some options
 accept multiple values (e.g. <option> = file1, file2), in which case the
@@ -432,6 +438,10 @@ to know in detail what *roverlay* does before running it.
 --nosync, --no-sync
    Disable downloading of R packages.
 
+--strict
+   Enable strict behavior.
+   For example, this causes *roverlay* to exit if any repo cannot be synced.
+
 --distmap-verify
    Enforce verification of R packages in the package mirror directory.
    This also tries to recreate the distmap.
@@ -671,6 +681,7 @@ eclass file are used, the result should look like:
    <overlay root>/
    <overlay root>/eclass
    <overlay root>/eclass/R-packages.eclass
+   <overlay root>/metadata/layout.conf
    <overlay root>/profiles
    <overlay root>/profiles/categories
    <overlay root>/profiles/repo_name
@@ -3085,7 +3096,7 @@ Example:
 
 
 Each flag is renamed at most once, so the following example renames 'sound'
-to media, but 'audio' to 'sound':;
+to media, but 'audio' to 'sound':
 
 ..  code-block:: text
 
@@ -3099,6 +3110,63 @@ to media, but 'audio' to 'sound':;
    unpredictable results.
 
 
+------------------
+ License Map File
+------------------
+
+The license map file is a file with dictionary-like entries that is used
+to translate *license strings* (read from the package's DESCRIPTION) into
+licenses accepted by portage, e.g. ``GPL-3`` or ``|| ( GPL-3+ BSD )``.
+Its syntax is similar to the dependency rule file syntax:
+
+..  code-block:: text
+
+   # this is a comment line
+
+   # 1,1 mapping
+   portage_license :: license_str
+
+   # 1,n mapping (n>=0)
+   portage_license {
+      license_str_0
+      license_str_1
+      ...
+      license_str_n
+   }
+
+   # 0,1 mapping (ignore license_str)
+   ! :: license_str
+
+   # 0,n mapping (ignore several license_str)
+   ! {
+      license_str_0
+      license_str_1
+      ...
+      license_str_n
+   }
+
+
+
+Example (excerpt from *roverlay's* license map file):
+
+..  code-block:: text
+
+   # freestyle text
+   ! {
+      foo
+      freeforresearchpurpose.
+      whatlicenseisitunder?
+   }
+
+   BSD :: freebsd
+
+   || ( GPL-2+ BSD ) {
+      gpl>2|bsd
+      gpl>2|freebsd
+   }
+
+
+
 .. _Field Definition:
 
 -------------------------
@@ -3267,6 +3335,7 @@ This is the default field definition file (without any ignored fields):
 roverlay provides an interactive console for accessing certain subsystems,
 e.g. dependency resolution. Its features include tab completion for filesystem
 paths and a command history that supports navigation with the arrow keys.
+Line continuation with a backslash character ``\`` is supported, too.
 
 The console also implements a subset of typical tools like ``cat``, which
 behave similar but not identical to their counterparts.
@@ -3347,7 +3416,7 @@ It is an interactive console with the following features:
 * save rules to a file
 
 Rules are managed in a set. These so-called *rule pools* are organized in
-a *first-in-first-out* data structure that allows to create or remove
+a *last-in-first-out* data structure that allows to create or remove
 them easily at runtime.
 
 Running ``roverlay depres_console`` prints a short welcome message and starts
@@ -3500,6 +3569,46 @@ For extending the API, roverlay provides the abstract *RoverlayInterface* and
 *RoverlaySubInterface* classes.
 
 
+The following code snippet gives an idea on how to include roverlay's API in
+your code:
+
+..  code-block:: python
+
+   #!/usr/bin/python
+   #
+   #  Initializes logging and roverlay's interfaces
+   #
+
+   import logging
+
+   import roverlay.core
+   import roverlay.interface.main
+
+   def main():
+      # log everything to console
+      roverlay.core.force_console_logging ( log_level=logging.INFO )
+
+      # load roverlay's config
+      config = roverlay.core.load_locate_config_file (
+         ROVERLAY_INSTALLED=False, setup_logger=False
+      )
+
+      # create the main interface
+      main_interface = roverlay.interface.main.MainInterface ( config=config )
+
+      # create subinterfaces, as needed
+      depres_interface = main_interface.spawn_interface ( "depres" )
+      remote_interface = main_interface.spawn_interface ( "remote" )
+
+      # use them
+      pass
+   # --- end of main (...) ---
+
+   if __name__ == '__main__':
+      main()
+
+
+
 ------------------
  DepRes Interface
 ------------------
@@ -3713,8 +3822,8 @@ package directories) and implements all overlay-related functionality:
 
 * Write the overlay to its filesystem location
 
-   * initialize the overlay (write the *profiles/* directory,
-     import eclass files)
+   * initialize the overlay (write the *profiles/* directory and
+     *metadata*/layout.conf, import eclass files)
    * Write ebuilds; all *PackageInfo* instances with an ebuild will be written
    * Generate and write metadata
    * Write Manifest files
@@ -3797,6 +3906,15 @@ class. An *EbuildVar* defines its position in the ebuild and  how its text
 output should look like. Ebuild text is created by adding ebuild variables
 to an *Ebuilder* that automatically sorts them and creates the ebuild.
 
+Most ebuild variables, e.g. all variables that contain text from a package's
+DESCRIPTION data, have basic protection against code injection:
+
+* only ASCII characters are allowed
+* the following chars are always removed: ``"``, ``'``, ````` and ``;``
+* backslash chars ``\`` at the end of the variable's value are removed
+* any char sequence starting with ``$(`` is completely dropped
+
+
 ------------------
  Overlay Creation
 ------------------


             reply	other threads:[~2013-08-07 16:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 16:10 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-08-23 19:03 [gentoo-commits] proj/R_overlay:master commit in: doc/rst/ André Erdmann
2014-07-29 18:29 André Erdmann
2014-08-23 19:03 ` André Erdmann
2014-07-18 16:20 André Erdmann
2014-06-05 22:09 André Erdmann
2013-11-14 18:24 André Erdmann
2013-09-23 15:30 André Erdmann
2013-09-23 12:34 André Erdmann
2013-09-16  8:56 André Erdmann
2013-09-03 14:32 André Erdmann
2013-08-27 15:39 André Erdmann
2013-08-23 13:52 André Erdmann
2013-08-19 15:42 André Erdmann
2013-08-09 15:27 André Erdmann
2013-08-06 16:02 André Erdmann
2013-08-02 14:30 André Erdmann
2013-08-01 17:14 André Erdmann
2013-07-23 18:34 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-23 18:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-23 14:57 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-23 14:57 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-16 16:35 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-16 16:36 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-15 22:31 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-16 16:36 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-03 10:05 André Erdmann
2013-07-03 10:04 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-03 10:05 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-26 17:29 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-30 15:58 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-25 21:10 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-30 15:58 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-18 14:12 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-18 14:12 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-12 21:10 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-13 16:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-05 18:08 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-13 16:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-04-25 16:44 André Erdmann
2013-03-05 11:27 André Erdmann
2013-01-28 23:54 André Erdmann
2013-01-09 19:15 André Erdmann
2012-08-20 11:16 André Erdmann
2012-08-17 17:26 André Erdmann
2012-08-16 16:28 André Erdmann
2012-08-15 16:14 André Erdmann
2012-08-14 15:24 André Erdmann
2012-08-10 17:54 André Erdmann
2012-08-10 15:16 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375890859.a7bdfc6904b64fae37e9b8a18134f07a9c55f0c6.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox