Recursive-functions-bash

The joy of creating recursive functions: BASH

Rather than hardcoding an order in which some procedure must be done in, it is much more fun and challenging to formalise the procedure to find out the order and let the program do that at runtime. Recursive functions offer nice way of solving this. I stumbled across the problem when trying to automate the backporting of R to the stable edition of Debian GNU/Linux. The building process should first build r-base-core and r-base-dev, then install them, then build a list of packages of which some, e.g. r-cran-kernsmooth requires others (e.g. r-cran-mass) to be installed before they could be built.

The ideal is to specify a meta-package, r-recommended, and have a recursive build-procedure it-self work out the order things must be built in.

algorithm:

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019