2006-12-09 03:51:42 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
ensureDir $out/etc
|
|
|
|
|
|
|
|
sources_=($sources)
|
|
|
|
targets_=($targets)
|
2007-08-16 17:09:06 +02:00
|
|
|
modes_=($modes)
|
2006-12-09 03:51:42 +01:00
|
|
|
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
|
|
|
ensureDir $out/etc/$(dirname ${targets_[$i]})
|
2009-05-18 14:59:01 +02:00
|
|
|
if ! test -e $out/etc/${targets_[$i]}; then
|
|
|
|
ln -s ${sources_[$i]} $out/etc/${targets_[$i]};
|
|
|
|
else
|
|
|
|
echo Duplicate entry "${targets_[$i]} -> ${sources_[$i]}"
|
|
|
|
if test "$(readlink "$targets_[$i]")" -ne "$sources_[$i]"; then
|
|
|
|
echo Mismatched duplicate entry "$(readlink "$targets_[$i]") "'<>'" $sources_[$i]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi;
|
2007-08-16 17:09:06 +02:00
|
|
|
if test "${modes_[$i]}" != symlink; then
|
|
|
|
echo "${modes_[$i]}" > $out/etc/${targets_[$i]}.mode
|
|
|
|
fi
|
2006-12-09 03:51:42 +01:00
|
|
|
done
|