From fbde080c660df1ec79c2f4d1bef0e935780c05ea Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 22 Nov 2008 15:27:54 +0100 Subject: pkg: populate_collected: Don't overwrite non-symlinks in ~/bin --- bin/pkg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/pkg b/bin/pkg index 8e81363..fdd851f 100755 --- a/bin/pkg +++ b/bin/pkg @@ -389,9 +389,13 @@ function populate_collected { } if [[ -d bin ]] { for i in bin/*(*); { - if [[ $(readlink $HOME/$i) != "../$1/$i" ]] { - rm -f $HOME/$i - ln -s ../${PDIR//$HOME\/}/$1/$i $HOME/$i + if [[ -L $HOME/$i || ! -e $HOME/$i ]] { + if [[ $(readlink $HOME/$i) != "../$1/$i" ]] { + rm -f $HOME/$i + ln -s ../${PDIR//$HOME\/}/$1/$i $HOME/$i + } + } else { + warn "populate_collected: Not updating ~/$i since it's not a symlink\n" } } } -- cgit v1.2.3