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=92029442509bee8d631798e5a9a45c077a55e7e4;hb=ccd715dc9c54c2aa715ca2fcde7add96197b3f1c;hpb=ca9c01af734be30d9d2043e766ec2baeddfed925 diff --git a/infra/makelinks b/infra/makelinks index 9202944..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 @@ -134,7 +146,7 @@ while read <&3 ours underhome; do if [ -d "$punderhome" ]; then good "directory exists" elif ! [ -e "$punderhome" ]; then - needs install "directory does not exist" + needs setup "directory does not exist" $act mkdir -p "$punderhome" else bad "ought to be director but isn't"