diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-22 15:27:54 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-22 15:27:54 +0100 |
commit | fbde080c660df1ec79c2f4d1bef0e935780c05ea (patch) | |
tree | 7778f1616cd6fab11b1fae91ecb56bd66d904647 | |
parent | 1a4408effeb6cac14b1003a80214fd68e2e91370 (diff) |
pkg: populate_collected: Don't overwrite non-symlinks in ~/bin
-rwxr-xr-x | bin/pkg | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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" } } } |