summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-11-22 15:27:54 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-11-22 15:27:54 +0100
commitfbde080c660df1ec79c2f4d1bef0e935780c05ea (patch)
tree7778f1616cd6fab11b1fae91ecb56bd66d904647
parent1a4408effeb6cac14b1003a80214fd68e2e91370 (diff)
pkg: populate_collected: Don't overwrite non-symlinks in ~/bin
-rwxr-xr-xbin/pkg10
1 files 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"
}
}
}