summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-21 17:10:52 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-21 17:10:52 +0200
commit9d80a90fc1f6d2f67c728681840b95a44dcc8704 (patch)
treec9f779284db1898026e220f56157043e6406bdac
parent1cf417bc899a15fbf8d79cb5b25d1f0182cb96a7 (diff)
Now automatically populating ~/bin
-rw-r--r--.links3
-rwxr-xr-xbin/pkg9
2 files changed, 5 insertions, 7 deletions
diff --git a/.links b/.links
index e7303e1..44435d1 100644
--- a/.links
+++ b/.links
@@ -1,4 +1 @@
-soft bin/checklinks ../packages/core/bin/checklinks
-soft bin/pkg ../packages/core/bin/pkg
-soft bin/removelinks ../packages/core/bin/removelinks
soft .hgrc packages/core/etc/hgrc
diff --git a/bin/pkg b/bin/pkg
index e75fe1c..b5ee520 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -216,8 +216,9 @@ populate_collected () {
clear_line
if ([ -d bin ]) {
for i in bin/*(*); {
- if ([ ! -e $PDIR/.collected/$i ]) {
- ln -s ../../$1/$i $PDIR/.collected/$i
+ if ([ -l "$HOME/$i" -a "$(readlink $HOME/$i)" != "../$1/$i" ]) {
+ rm -f "$HOME/$i"
+ ln -s ../${PDIR//$HOME\/}/$1/$i $HOME/$i
}
}
}
@@ -246,8 +247,8 @@ genocide_collected () {
clear_line
if ([ -d bin ]) {
for i in bin/*(*); {
- if ([ "$(readlink $PDIR/.collected/$i)" = "../../$1/$i" ]) {
- rm -f $PDIR/.collected/$i
+ if ([ "$(readlink $HOME/$i)" = "../$1/$i" ]) {
+ rm -f $HOME/$i
}
}
}