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