summaryrefslogtreecommitdiff
path: root/g
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-11-19 11:20:18 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-11-30 20:25:21 -0600
commit8a71b563c9c6aee048dd237d8c443a0505e5adf8 (patch)
tree6f1485f09f5ee634ff979912bceca0db27510569 /g
parentbc663e966a007c8ed4b5f55090c12ca707448b9c (diff)
build: Fix ./g clone.
Diffstat (limited to 'g')
-rwxr-xr-xg22
1 files changed, 12 insertions, 10 deletions
diff --git a/g b/g
index 7e3fd2a01332..e41042293a74 100755
--- a/g
+++ b/g
@@ -117,10 +117,10 @@ if [ "$COMMAND" = "clone" ] ; then
help impress libs-core libs-extern libs-extern-sys libs-gui
postprocess sdk testing ure writer"
fi
-for D in $DIRS ; do
- DIR="$CLONEDIR/$D"
- NAME="$D"
- if [ "$D" = "bootstrap" ] ; then
+for REPO in $DIRS ; do
+ DIR="$CLONEDIR/$REPO"
+ NAME="$REPO"
+ if [ "$REPO" = "bootstrap" ] ; then
DIR="$RAWBUILDDIR"
NAME="main repo"
fi
@@ -128,7 +128,11 @@ for D in $DIRS ; do
if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
(
# executed in a subshell
- [ "$COMMAND" != "clone" ] && cd "$DIR"
+ if [ "$COMMAND" != "clone" ] ; then
+ cd "$DIR"
+ else
+ cd "$CLONEDIR"
+ fi
# relativize the absolutized params again if we want to operate
# only on the files belonging to this exact repo
@@ -138,7 +142,7 @@ for D in $DIRS ; do
PWD=`pwd`
PWDLEN=`pwd | wc -c`
for I in "${FILES[@]}" ; do
- I="${I//@REPO@/${DIR}}"
+ I="${I//@REPO@/${REPO}}"
unset FILES[$FILESNUM]
FILESNUM=$(($FILESNUM+1))
# filter out files that don't belong to this repo
@@ -183,9 +187,7 @@ for D in $DIRS ; do
fi
;;
clone)
- if [ -z "$FILES" ]; then
- EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${DIR}"
- fi
+ EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${REPO}"
;;
esac
@@ -211,7 +213,7 @@ for D in $DIRS ; do
for link in `ls` ; do
if [ ! -e "$RAWBUILDDIR/$link" ] ; then
echo "Creating missing link $link"
- ln -s "$CLONEDIR/$DIR/$link" "$RAWBUILDDIR/$link"
+ ln -s "$DIR/$link" "$RAWBUILDDIR/$link"
fi
done
;;