NAME

Config::Generator::File - Config::Generator file support

DESCRIPTION

This module eases the manipulation of files, directories and symbolic links.

The goal is to perform all the file related operations through this module so that there is a consistent handling of the Config::Generator variables: $NoAction, $RootDir and $Verbosity.

In addition, rpm compatible spec files snippets can be generated and the yacg command can use a "manifest" file to record which files it did create. This is required in order to be able to "clean out the junk", see yacg's --clean option.

FUNCTIONS

This module provides the following functions (none of them being exported by default):

ensure_directory(PATH)

make sure the given PATH is a directory

ensure_file(PATH, CONTENTS)

make sure the given PATH is a file with the given CONTENTS

ensure_symlink(PATH, TARGET)

make sure the given PATH is a symbolic link with the given TARGET

ensure_mode(PATH, MODE)

make sure the given PATH has the given numerical MODE

ensure_user(PATH, USER)

make sure the given PATH is owned by the given USER

ensure_group(PATH, GROUP)

make sure the given PATH is owned by the given GROUP

files_manifest()

return the list of all the files that have been manipulated by this module

files_spec()

return the list of all the files that have been manipulated by this module, in a format compatible with rpm's spec %files

handle_manifest(PATH, CLEAN)

write the list of all the files that have been manipulated by this module in a "manifest" file at the given PATH; if CLEAN is true, also remove all the files and directories that were in the previous manifest and are not present anymore

handle_spec(PATH)

write the list of all the files that have been manipulated by this module in a "spec" file at the given PATH

AUTHOR

Lionel Cons http://cern.ch/lionel.cons

Copyright (C) CERN 2013-2014