4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
17 shopt -s extglob
# note, already set with bash -l
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 # note, symlinks get resolved, not copied.
51 sysv s
cp -RL ${fs_files[@]} /
53 if [[ -e $dir/subdir_files
]]; then
54 subdir-link-r
$dir/subdir_files
56 local x
=( $dir/!(subdir_files|filesystem|machine_specific
) )
57 (( ${#x[@]} >= 1 )) ||
continue
62 all_dirs
=({/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME})
63 c_dirs
=(/a
/c
{,/machine_specific
/$HOSTNAME})
66 # p needs to go first so .ssh link is created, then config link inside it
67 common-file-setup
${all_dirs[@]}
68 sudo
-u traci
"$BASH_SOURCE"
71 common-file-setup
${c_dirs[@]}
74 echo "$0: error: unexpected user"; exit 1