MozillaFirefox/create-tar.sh
changeset 646 a3eaf3bb0cc9
parent 645 a9f3d5963cc0
child 647 9d8bdcdd4d2a
--- a/MozillaFirefox/create-tar.sh	Sun Apr 14 11:29:37 2013 +0200
+++ b/MozillaFirefox/create-tar.sh	Fri May 10 07:16:10 2013 +0200
@@ -6,8 +6,26 @@
 VERSION="20.99"
 
 # mozilla
-echo "cloning $BRANCH..."
-hg clone http://hg.mozilla.org/$BRANCH mozilla
+if [ -d mozilla ]; then
+  pushd mozilla
+  _repourl=$(hg paths)
+  case "$_repourl" in
+    *$BRANCH*)
+      echo "updating previous tree"
+      hg pull
+      popd
+      ;;
+    * )
+      echo "removing obsolete tree"
+      popd
+      rm -rf mozilla
+      ;;
+  esac
+fi
+if [ ! -d mozilla ]; then
+  echo "cloning new $BRANCH..."
+  hg clone http://hg.mozilla.org/$BRANCH mozilla
+fi
 pushd mozilla
 [ "$RELEASE_TAG" == "default" ] || hg update -r $RELEASE_TAG
 # get repo and source stamp