summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Gass <mxey@ghosthacking.net>2011-06-26 14:19:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-26 14:38:46 +0200
commit9be56f702ba679fe0ad9fd8193bc8aa7b526a716 (patch)
tree23231fdbbae60b07a616b0cb788d34cefa54cf8d
parent2b6105a50027ab2e6007998967f9a46aa4cac6fe (diff)
Add hook helpers collect_into_{directory,file}
-rwxr-xr-xbin/ct22
1 files changed, 22 insertions, 0 deletions
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}