From: Ian Kelling Date: Mon, 26 Sep 2016 22:48:15 +0000 (-0700) Subject: bash 4.4 fix X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=935ac5b0c6bb279d461bac08866f2b70a8e648dc bash 4.4 fix --- diff --git a/conflink b/conflink index d348078..c385ca0 100755 --- a/conflink +++ b/conflink @@ -5,7 +5,7 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR sysv() { - e "$@" + echo "$@" "$@" } @@ -14,7 +14,7 @@ sysv() { shopt -s nullglob -shopt -s extglob +shopt -s extglob # note, already set with bash -l # if we make a link back to the root, traversing the subdirs stops. # This makes it so we can do subdir directories. Must call with absolute @@ -24,9 +24,9 @@ subdir-link-r() { local root="$1" local targets=() if [[ $2 ]]; then - targets=( "$2"/!(.git) ) + targets=( "$2"/!(.git|..|.) ) else - for f in "$1"/!(.git); do + for f in "$1"/!(.git|..|.); do [[ -d $f ]] && targets+=("$f") ||: done fi @@ -47,7 +47,8 @@ common-file-setup() { for dir in "$@"; do fs_files=( $dir/filesystem/* ) if [[ -e ${fs_files[0]} && $USER == ian ]]; then - sysv s cp -R ${fs_files[@]} / + # note, symlinks get resolved, not copied. + sysv s cp -RL ${fs_files[@]} / fi if [[ -e $dir/subdir_files ]]; then subdir-link-r $dir/subdir_files