summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-04-12 12:37:04 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-04-12 12:37:04 +0200
commit57d5db7d4e42a29a9205ac101a2119bcdac8a03c (patch)
tree987d48e0390cf84da1d1616ab2583bbb1da47a58 /bin
parente483ca59a6ed91f584b4e889a8b4ab79cc199183 (diff)
Added support and tests for a package directory outside of /home
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/pkg b/bin/pkg
index 9a5ef98..0263ae9 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -559,7 +559,11 @@ function populate_collected {
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
+ if [[ $PDIR == ${HOME}* ]] {
+ ln -s ../${PDIR//$HOME\/}/$1/$i $HOME/$i
+ } else {
+ ln -s $PDIR/$1/$i $HOME/$i
+ }
}
} else {
warn "populate_collected: Not updating ~/$i since it's not a symlink\n"
@@ -586,7 +590,7 @@ function genocide_collected {
}
clear_line
for i in bin/*(-*N); {
- if [[ $(readlink $HOME/$i) = "../${PDIR//$HOME\/}/$1/$i" ]] {
+ if [[ $(readlink $HOME/$i) == (../${PDIR//$HOME\/}|$PDIR)/$1/$i ]] {
rm -f $HOME/$i
}
}