diff options
author | Maximilian Gass <mxey@ghosthacking.net> | 2011-06-26 14:19:29 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-06-26 14:38:46 +0200 |
commit | 9be56f702ba679fe0ad9fd8193bc8aa7b526a716 (patch) | |
tree | 23231fdbbae60b07a616b0cb788d34cefa54cf8d | |
parent | 2b6105a50027ab2e6007998967f9a46aa4cac6fe (diff) |
Add hook helpers collect_into_{directory,file}
-rwxr-xr-x | bin/ct | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -430,6 +430,28 @@ function run_checklinks { } } +## Hook helper functions + +function collect_into_directory { + typeset directory=${1} + shift + + info "collecting into $directory: $*\n" + rm -rf ${directory} + mkdir -p ${directory} + + if [[ -e ${1} ]] { + ln -s ${*} ${directory} + } +} + +function collect_into_file { + typeset out=${1} + shift + + info "collecting into ${out}: ${*}\n" + cat /dev/null ${*} > ${out} +} function exec_hook { typeset package=${1} |