summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:02:48 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:02:48 +0200
commit1157832dffda67049384f2fc57c6312e3e6834d2 (patch)
treeb4616369435c38ea0876bc8f3f566e6f86f76402 /bin/pkg
parent518b9a107ef971ba2ce8c0c8f71e2c3e7dc77f4a (diff)
bin/pkg: Added function 'changesrc' to change all packages' source URLs
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