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 if [[ $dir == /p
/* ]]; then
40 for user
in ${homes[@]}; do
41 sysv lnf
-T "$path" "$user/${path#$root/}"
43 elif [[ -d "$path" ]]; then
44 subdir-link-r
"$root" "$path"
50 if [[ -e $1/subdir_files
]]; then
51 subdir-link-r
$1/subdir_files
53 local x
=( $1/!(subdir_files|filesystem
) )
54 (( ${#x[@]} >= 1 )) ||
return 0
56 # as of this writing, it doesn't exist in /a/c, but I've used it in the past.
57 if [[ -e $1/filesystem
]]; then
58 sysv s
cp -R $1/filesystem
/* /
62 # p needs to go first so .ssh link is created, then config link inside it
63 for dir
in {/a
/c
,/p
/c
}{,/machine_specific
/$HOSTNAME}; do
64 common-file-setup
$dir