Skip to content

Commit

Permalink
GUIDELINES: formatting consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
daler committed Jun 17, 2016
1 parent c24fe4e commit 906f855
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,21 @@ Examples of somewhat non-standard recipes, in no particular order:
distribution
* [hisat2](recipes/hisat2) runs `2to3` to make it Python 3 compatible, and
copies over individual scripts to the bin dir
* [krona](recipes/krona) has a `post-link.sh` script that gets called after installation to alert the user a manual step is required
* [krona](recipes/krona) has a `post-link.sh` script that gets called after
installation to alert the user a manual step is required
* [htslib](recipes/htslib) has a small test script that creates example data
and runs multiple programs on it
* [spectacle](recipes/spectacle) runs `2to3` to make the wrapper script Python
3 compatible, patches the wrapper script to have a shebang line, deletes
example data to avoid taking up space in the bioconda channel, and includes
a script for downloading the example data separately.
* [gatk](recipes/gatk) is a package for licensed software that cannot be redistributed. The package installs a placeholder script (in this case doubling as the `jar` [wrapper](https://github.com/bioconda/bioconda-recipes/blob/master/GUIDELINES.md#java)) to alert the user if the program is not installed, along with a separate script (`gatk-register`) to copy in a user-supplied archive/binary to the conda environment
* [gatk](recipes/gatk) is a package for licensed software that cannot be
redistributed. The package installs a placeholder script (in this case
doubling as the `jar`
[wrapper](https://github.com/bioconda/bioconda-recipes/blob/master/GUIDELINES.md#java))
to alert the user if the program is not installed, along with a separate
script (`gatk-register`) to copy in a user-supplied archive/binary to the
conda environment

### Name collisions
In some cases, there may be a name collision when writing a recipe. For example the
Expand Down Expand Up @@ -222,12 +229,23 @@ It is recommended to pipe unneeded stdout/stderr to /dev/null to avoid
cluttering the output in the Travis-CI build environment.

## Link and unlink scripts (pre- and post- install hooks)
It is possible to include [scripts](http://conda.pydata.org/docs/spec.html#link-and-unlink-scripts) that are executed before or
after installing a package, or before uninstalling a package. These scripts can be helpful for alerting the user that manual actions are required after adding or removing a package. For example, a `post-link.sh` script may be used to alert the user that he or she will need to create a database or modify a settings file. Any package that requires a manual preparatory step before it can be used should consider alerting the user via an `echo` statement in a `post-link.sh` script. These scripts may be added at the same level as `meta.yaml` and `build.sh`:
It is possible to include
[scripts](http://conda.pydata.org/docs/spec.html#link-and-unlink-scripts) that
are executed before or after installing a package, or before uninstalling
a package. These scripts can be helpful for alerting the user that manual
actions are required after adding or removing a package. For example,
a `post-link.sh` script may be used to alert the user that he or she will need
to create a database or modify a settings file. Any package that requires
a manual preparatory step before it can be used should consider alerting the
user via an `echo` statement in a `post-link.sh` script. These scripts may be
added at the same level as `meta.yaml` and `build.sh`:

* `pre-link.sh` is executed *prior* to linking (installation). An error causes conda to stop.
* `post-link.sh` is executed *after* linking (installation). When the post-link step fails, no package metadata is written, and the package is not considered installed.
* `pre-unlink.sh` is executed *prior* to unlinking (uninstallation). Errors are ignored. Used for cleanup.
* `post-link.sh` is executed *after* linking (installation). When the post-link
step fails, no package metadata is written, and the package is not considered
installed.
* `pre-unlink.sh` is executed *prior* to unlinking (uninstallation). Errors are
ignored. Used for cleanup.

These scripts have access to the following environment variables:

Expand Down

0 comments on commit 906f855

Please sign in to comment.