summaryrefslogtreecommitdiff
path: root/g
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-01-20 15:44:25 +0000
committerMichael Meeks <michael.meeks@novell.com>2011-01-20 15:47:18 +0000
commit5dd4778d66b5ac1acc7d42ef391c00b4d8dae408 (patch)
tree955c5dccdfd62cd7ed0e71b3b91693a1c8580cf5 /g
parent142a314a70931738bf49911d0e2d7bfdbf5494cb (diff)
cope with change of path, and broken absolute links this generates
Diffstat (limited to 'g')
-rwxr-xr-xg18
1 files changed, 12 insertions, 6 deletions
diff --git a/g b/g
index 2f6fcd444ec7..d033a0c37a89 100755
--- a/g
+++ b/g
@@ -234,12 +234,18 @@ for REPO in $DIRS ; do
case "$COMMAND" in
pull|clone)
# update links
- for link in $(ls) ; do
- if [ ! -e "$RAWBUILDDIR/$link" ] ; then
- echo "Creating missing link $link"
- ln -s "$DIR/$link" "$RAWBUILDDIR/$link"
- fi
- done
+ if [ "$DIR" != "$RAWBUILDDIR" ]; then
+ for link in $(ls) ; do
+ if [ ! -e "$RAWBUILDDIR/$link" ] ; then
+ if test -h "$RAWBUILDDIR/$link"; then
+ rm "$RAWBUILDDIR/$link"
+ echo -n "re-"
+ fi
+ echo "creating missing link $link $DIR/$link -> $RAWBUILDDIR/$link"
+ ln -sf "$DIR/$link" "$RAWBUILDDIR/$link"
+ fi
+ done
+ fi
;;
status)
# git status returns error in some versions, clear that