2006-12-09 02:51:42 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
|
2012-05-17 18:43:45 +00:00
|
|
|
mkdir -p $out/etc
|
2006-12-09 02:51:42 +00:00
|
|
|
|
2012-05-17 18:43:45 +00:00
|
|
|
set -f
|
2006-12-09 02:51:42 +00:00
|
|
|
sources_=($sources)
|
|
|
|
targets_=($targets)
|
2007-08-16 15:09:06 +00:00
|
|
|
modes_=($modes)
|
2014-02-18 08:09:01 +00:00
|
|
|
uids_=($uids)
|
|
|
|
gids_=($gids)
|
2012-05-17 18:43:45 +00:00
|
|
|
set +f
|
|
|
|
|
2006-12-09 02:51:42 +00:00
|
|
|
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
2012-05-17 18:43:45 +00:00
|
|
|
source="${sources_[$i]}"
|
|
|
|
target="${targets_[$i]}"
|
|
|
|
|
|
|
|
if [[ "$source" =~ '*' ]]; then
|
|
|
|
|
|
|
|
# If the source name contains '*', perform globbing.
|
|
|
|
mkdir -p $out/etc/$target
|
|
|
|
for fn in $source; do
|
|
|
|
ln -s "$fn" $out/etc/$target/
|
|
|
|
done
|
|
|
|
|
2009-05-18 12:59:01 +00:00
|
|
|
else
|
2012-05-17 18:43:45 +00:00
|
|
|
|
|
|
|
mkdir -p $out/etc/$(dirname $target)
|
|
|
|
if ! [ -e $out/etc/$target ]; then
|
|
|
|
ln -s $source $out/etc/$target
|
|
|
|
else
|
2012-10-05 01:44:45 +00:00
|
|
|
echo "duplicate entry $target -> $source"
|
2012-05-17 18:43:45 +00:00
|
|
|
if test "$(readlink $out/etc/$target)" != "$source"; then
|
2012-10-05 01:44:45 +00:00
|
|
|
echo "mismatched duplicate entry $(readlink $out/etc/$target) <-> $source"
|
2012-05-17 18:43:45 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "${modes_[$i]}" != symlink; then
|
|
|
|
echo "${modes_[$i]}" > $out/etc/$target.mode
|
2014-02-18 08:09:01 +00:00
|
|
|
echo "${uids_[$i]}" > $out/etc/$target.uid
|
|
|
|
echo "${gids_[$i]}" > $out/etc/$target.gid
|
2009-08-16 13:14:33 +00:00
|
|
|
fi
|
2012-05-17 18:43:45 +00:00
|
|
|
|
2007-08-16 15:09:06 +00:00
|
|
|
fi
|
2006-12-09 02:51:42 +00:00
|
|
|
done
|
2011-09-06 12:32:07 +00:00
|
|
|
|