4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
16 # if we make a link back to the root, traversing the subdirs stops.
17 # This makes it so we can do subdir directories. Must call with absolute
24 targets
=( "$2"/!(.git
) )
26 for f
in "$1"/!(.git
); do
27 [[ -d $f ]] && targets
+=("$f") ||
:
30 local below
="$( readlink -f "$root/..
")"
31 for path
in "${targets[@]}"; do
32 local fullpath
="$(readlink -f "$path")"
33 #e $fullpath $below # debug
34 if [[ -f $path || $
(dirname $
(readlink
-f "$fullpath")) == "$below" ]]; then
35 sysv lnf
-T "$path" "$HOME/${path#$root/}"
36 elif [[ -d "$path" ]]; then
37 subdir-link-r
"$root" "$path"
43 if [[ -e $1/subdir_files
]]; then
44 subdir-link-r
$1/subdir_files
46 local x
=( $1/!(subdir_files|filesystem
) )
47 (( ${#x[@]} >= 1 )) ||
return 0
49 # as of this writing, it doesn't exist in /a/c, but I've used it in the past.
50 if [[ -e $1/filesystem
&& $USER == ian
]]; then
51 sysv s
cp -R $1/filesystem
/* /
57 # p needs to go first so .ssh link is created, then config link inside it
58 for dir
in {/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME}; do
59 common-file-setup
$dir
61 sudo
-u traci
"$BASH_SOURCE"
64 for dir
in /a
/c
{,/machine_specific
/$HOSTNAME}; do
65 common-file-setup
$dir
69 echo "$0: error: run as ian or traci"