X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=gitslink;h=99ef892606d27855bb078addb25ea7bd534a1bd2;hp=1352ecd9290bcf6cc615aa106c78fd0b89f38b9e;hb=32a1673064cfd9eaa165b4ea62fa416f02f3dfd2;hpb=4d0dc703ef2e62cd16ea84f27456f6f50f74baa3 diff --git a/gitslink b/gitslink index 1352ecd..99ef892 100755 --- a/gitslink +++ b/gitslink @@ -8,31 +8,41 @@ lnf() { /a/bin/lnf/lnf "$@"; } shopt -s nullglob shopt -s extglob +cd /a/exe +declare -A existing +for f in *; do + existing[$f]=t +done cd /a/bin -# if we didn't have just automated files, we could cleanup -# links to not executable files. -e rm -rf /a/exe # sourcing instead of calling script changes runtime from .47s to .36s source /a/bin/lnf/lnf >/dev/null ||: -for x in !(unused|unfinished|queue|bash-template|buildscripts|crons|data|examples|log-quiet); do - [[ -e $x/.git ]] || continue - for y in $x/*; do - if [[ -x $y && ! -d $y ]]; then - lnf -v /a/bin/$y /a/exe - fi - done +for x in !(unused|distro-setup|unfinished|queue|bash-template|buildscripts|crons|data|examples|log-quiet); do + [[ -e $x/.git ]] || continue + for y in $x/*; do + f=${y##*/} + if [[ -x $y && ! -d $y ]]; then + unset "existing[$f]" + lnf -v /a/bin/$y /a/exe + fi + done done - for x in *; do - if [[ ! -d $x && -x $x ]]; then - lnf -v /a/bin/$x /a/exe - fi + if [[ ! -d $x && -x $x ]]; then + unset "existing[$x]" + lnf -v /a/bin/$x /a/exe + fi done +cd /a/exe +for f in ${!existing[@]}; do + echo want to do rm -fv $f +done + + + # things we don't want to run in /a, because # they are long running and could get in the way of # btrfs remounting -/a/bin/distro-setup/install-my-scripts -/a/bin/log-quiet/setup +e /a/bin/distro-setup/install-my-scripts