X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=infra%2Fmakelinks;h=46c901e9b0c0a3d17a62abac41802243d6e6e231;hb=5a61a99b3823ae30f69da05464124583ea34922f;hp=20faafc592912d757c74acf5b4de56e381d45e2e;hpb=4e6e460b957774e2e7f60d0fbd8de9e84ca7f980;p=ian-dotfiles.git diff --git a/infra/makelinks b/infra/makelinks index 20faafc..46c901e 100755 --- a/infra/makelinks +++ b/infra/makelinks @@ -76,6 +76,18 @@ process_object () { inhome="$HOME/$underhome" prhome="~/$underhome" linktarget="$basepath/$ours" + chompy="$underhome" + while true; do + case "$chompy" in + *?/?*) + linktarget="../$linktarget" + chompy="${chompy%/*}" + ;; + *) + break + ;; + esac + done if [ "$inhome" -ef "$ours" ]; then good "already symlinked here" elif [ -h "$inhome" ]; then @@ -121,6 +133,31 @@ for ours in $nondots; do process_object done +exec 3