summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index 15d2d1c..ccdfa07 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -81,8 +81,18 @@ pkg_update () {
}
}
+pkg_changesrc () {
+ cd $PDIR
+ for i in *(/); {
+ if [ -f $i/.hg/hgrc ]; then
+ sed -ri "s!(default = )[^:]*://[^/]*/!\1$1/!" $i/.hg/hgrc
+ fi
+ }
+}
+
case "$1" in
add) pkg_add "$2" ;;
- update) pkg_update ;;
+ changeroot) pkg_changesrc "$2" ;;
remove) pkg_remove "$2" ;;
+ update) pkg_update ;;
esac