summaryrefslogtreecommitdiff
path: root/g
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-07-10 12:57:01 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-07-10 19:09:56 +0200
commit79e9a64299d7fb5abafdde5502093b899f36193a (patch)
tree8ac4a163b6c642976e572129c828212797d43414 /g
parent4cbdfe189811a622cc90763ce6c9c8166de48025 (diff)
make ./g robust against missing bin/repo-list file
Change-Id: Ib61a679221d0eddea61358024d31c90464dccefb
Diffstat (limited to 'g')
-rwxr-xr-xg11
1 files changed, 9 insertions, 2 deletions
diff --git a/g b/g
index 11ecaa607cbd..7ec3bdae745b 100755
--- a/g
+++ b/g
@@ -31,6 +31,13 @@ pushd $(dirname $0) > /dev/null
COREDIR=$(pwd)
popd > /dev/null
+if test -f $COREDIR/bin/repo-list
+then
+ ALLREPOS="core `cat "$COREDIR/bin/repo-list"`"
+else
+ ALLREPOS=core
+fi
+
refresh_hooks()
{
repo=$1
@@ -88,7 +95,7 @@ refresh_hooks()
refresh_all_hooks()
{
- repos="core $(cat "$COREDIR/bin/repo-list")"
+ repos="$ALLREPOS"
for repo in $repos ; do
refresh_hooks $repo
done
@@ -239,7 +246,7 @@ done
# do it!
DIRS="core $(cd $CLONEDIR ; ls)"
if [ "$COMMAND" = "clone" ] ; then
- DIRS=$(cat "$COREDIR/bin/repo-list")
+ DIRS="$ALLREPOS"
fi
for REPO in $DIRS ; do
DIR="$CLONEDIR/$REPO"