From 9be56f702ba679fe0ad9fd8193bc8aa7b526a716 Mon Sep 17 00:00:00 2001 From: Maximilian Gass Date: Sun, 26 Jun 2011 14:19:29 +0200 Subject: Add hook helpers collect_into_{directory,file} --- bin/ct | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bin/ct b/bin/ct index 338fe8a..b63a3fd 100755 --- a/bin/ct +++ b/bin/ct @@ -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} -- cgit v1.2.3