X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=ian-dotfiles.git;a=blobdiff_plain;f=infra%2Fmakelinks;h=46c901e9b0c0a3d17a62abac41802243d6e6e231;hp=e4fa88db3d3bf755f8d9d18d360220761f2785ec;hb=ccd715dc9c54c2aa715ca2fcde7add96197b3f1c;hpb=8d80d23fdac44173b01a61437c7b4ac7000f0df0 diff --git a/infra/makelinks b/infra/makelinks index e4fa88d..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 @@ -123,10 +135,27 @@ done exec 3