- From: Allan Wind <
>
- To:
- Subject: [chef] Re: Find top-level directories according to file specificity, stow installed directories
- Date: Thu, 21 Oct 2010 17:35:28 -0400
On 2010-10-20T17:36:18, Allan Wind wrote:
>
I would like to create a recipe that installs the available top-level
>
directories
>
in files. For example:
>
>
files/
>
default/
>
a/
>
...
>
redhat/
>
b/
>
...
>
>
on redhat it would mean calling remote_directory with 'a' and
>
'b', otherwise just 'a'. How do I find the directories in
>
question?
The private method preferences_for_path implements the search path, and
all public methods that make use of the former requires a
directory component.
The attribute method file_filenames (including method manifest)
dumps all files, so on can probably figure out how to extract
all unique, top-level directories, then pass each through
relative_filenames_in_preferred_directory and handle
the exception to figure out which applies.
In my case I needed to check a list of candidates so ended up
calling relative_filenames_in_preferred_directory for each and
handling the exception.
/Allan
--
Allan Wind
Life Integrity, LLC
<
http://lifeintegrity.com>
Archive powered by MHonArc 2.6.16.