4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
19 # if we make a link back to the root, traversing the subdirs stops.
20 # This makes it so we can do subdir directories. Must call with absolute
27 targets
=( "$2"/!(.git
) )
29 for f
in "$1"/!(.git
); do
30 [[ -d $f ]] && targets
+=("$f") ||
:
33 local below
="$( readlink -f "$root/..
")"
34 for path
in "${targets[@]}"; do
35 local fullpath
="$(readlink -f "$path")"
36 #e $fullpath $below # debug
37 if [[ -f $path || $
(dirname $
(readlink
-f "$fullpath")) == "$below" ]]; then
38 sysv lnf
-T "$path" "$HOME/${path#$root/}"
39 elif [[ -d "$path" ]]; then
40 subdir-link-r
"$root" "$path"
48 fs_files
=( $dir/filesystem
/* )
49 if [[ -e ${fs_files[0]} && $USER == ian
]]; then
50 sysv s
cp -R ${fs_files[@]} /
52 if [[ -e $dir/subdir_files
]]; then
53 subdir-link-r
$dir/subdir_files
55 local x
=( $dir/!(subdir_files|filesystem|machine_specific
) )
56 (( ${#x[@]} >= 1 )) ||
continue
61 all_dirs
=({/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME})
62 c_dirs
=(/a
/c
{,/machine_specific
/$HOSTNAME})
65 # p needs to go first so .ssh link is created, then config link inside it
66 common-file-setup
${all_dirs[@]}
67 sudo
-u traci
"$BASH_SOURCE"
70 common-file-setup
${c_dirs[@]}
73 echo "$0: error: unexpected user"; exit 1