diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-11-19 11:20:18 +0100 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-11-30 20:25:21 -0600 |
commit | 8a71b563c9c6aee048dd237d8c443a0505e5adf8 (patch) | |
tree | 6f1485f09f5ee634ff979912bceca0db27510569 /g | |
parent | bc663e966a007c8ed4b5f55090c12ca707448b9c (diff) |
build: Fix ./g clone.
Diffstat (limited to 'g')
-rwxr-xr-x | g | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -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 ;; |