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=96218b9ed712c46bea4cf57ca14e4ce9e0911243;hb=ccd715dc9c54c2aa715ca2fcde7add96197b3f1c;hpb=3a92cd02ee19db8d983213818553e05d6e037e67 diff --git a/infra/makelinks b/infra/makelinks index 96218b9..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 @@ -114,9 +126,42 @@ for ours in $dots; do process_object done +nondots=$( find home -mindepth 1 -maxdepth 1 -name '[0-9a-zA-Z]*[0-9a-zA-Z]' ) + +for ours in $nondots; do + underhome="${ours#home/}" + process_object +done + +exec 3