Package: extro.py
# Extro.pyExtro.py reads dependency information from a set of directories andproduces an ordered listing of this directories.## UsagePass a list of directories to the `extropy` command:$ cd /some/place$ for dir in $(extropy *); do> (cd $dir && ./run)> done## Specifying dependency informationExtro.py looks for dependency information inside the `.deps` directory ofeach named directory.  Inside the `.deps` directory it will readinformation from the following files:- `requires` -- Names (basename only, not paths) of directoriesrequired by this directory.- `required_by` -- This is a reverse `requires`.  If `dir1` is*required_by* `dir2`, that is the same as if `dir2` had listed `dir1`in its `requires` file.- `provides` -- a list of aliases that can be used to refer to thecurrent directory.## ExampleIn this example, we'll use Extro.py to help manage the runtimeinitialization of Docker containers.A Docker container is built from a series of layers.  Each layer maywant to perform some runtime initialization when a container starts.In this situation it is likely that there needs to be an orderingbetween these initialization tasks.One solution is for each layer to place initialization informationinto a subdirectory of `/docker/config.d`.  Then have an `ENTRYPOINT`script that looks something like this:#!/bin/shfor dir in $(extropy /docker/config.d/*); do(cd $dir && ./run)doneexec "$@"This will execute the `run` command inside each subdirectory, whilepermitting you to define an explicit ordering between differentlayers. For example, let's say you have a base image that implementssome sort of process supervision and logging.  It needs to ensure thatthe target log directory has appropriate ownership (and this needs tohappen at runtime, in case the directory is a mounted volume).On top of that logging image, you build a new image that runs a webapplication. The web application needs to perform some databaseinitialization tasks when it starts up, and you want to make sure thatlogging is configured *before* you run the database initialization.To solve this, you have your logging container install the directory`/docker/config.d/logging` with the following content:/docker/config.d/logging/runAnd you have your web application provide:/docker/config.d/webapp/run.deps/requiresAnd the `requires` file contains `logging`.  With this in place, the`ENTRYPOINT` script will run the `run` script for both directories,and the `logging` run script will always run before the `webapp` runscript.## Licenseextro.py -- imposes an ordering on a list of directoriesCopyright (C) 2016 Lars Kellogg-Stedman <lars@oddbit.com>This program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program.  If not, see <http://www.gnu.org/licenses/>.