gst-inspect: fix unused-const-variable error in windows
[platform/upstream/gstreamer.git] / scripts / git-update.sh
index bb028d6..25cb7cc 100755 (executable)
@@ -12,9 +12,11 @@ CORE="\
     gstreamer gst-plugins-base"
 MODULES="\
     gst-plugins-good gst-plugins-ugly gst-plugins-bad \
-    gst-ffmpeg \
-    gst-python \
-    gnonlin"
+    gst-libav"
+EXTRA_MODULES="\
+    gst-editing-services \
+    gst-rtsp-server \
+    gst-python"
 
 tmp=${TMPDIR-/tmp}
 tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$
@@ -25,20 +27,21 @@ tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$
 }
 
 ERROR_LOG="$tmp/failures.log"
-touch $ERROR_LOG
 ERROR_RETURN=255
 
-for m in $CORE $MODULES; do
+CPUCORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu  2>/dev/null || echo "1")
+
+for m in $CORE $MODULES $EXTRA_MODULES; do
   if test -d $m; then
     echo "+ updating $m"
     cd $m
 
-    git pull origin master
+    git pull --rebase
     if test $? -ne 0
     then
       echo "$m: update (trying stash, pull, stash apply)" >> $ERROR_LOG
       git stash
-      git pull origin master
+      git pull --rebase
       if test $? -ne 0
       then 
         echo "$m: update" >> $ERROR_LOG
@@ -63,33 +66,34 @@ build()
 {
   if test -d $1; then
     cd $1
-    if test ! -e Makefile -a -e autoregen.sh
+    if test ! -e Makefile
     then
-      echo "+ $1: autoregen.sh"
-      ./autoregen.sh > "$tmp/$1-regen.log" 2>&1
-      if test $? -ne 0
+      if test -e autoregen.sh
       then
-        echo "$1: autoregen.sh [$tmp/$1-regen.log]" >> $ERROR_LOG
-        cd ..
-        return $ERROR_RETURN
-      fi
-      echo "+ $1: autoregen.sh done"
-    fi
-    else if test ! -e Makefile
-    then
-       echo "+ $1: autogen.sh"
-      ./autogen.sh > "$tmp/$1-gen.log" 2>&1
-      if test $? -ne 0
-      then
-        echo "$1: autogen.sh [$tmp/$1-gen.log]" >> $ERROR_LOG
-        cd ..
-        return $ERROR_RETURN
+        echo "+ $1: autoregen.sh"
+        ./autoregen.sh > "$tmp/$1-regen.log" 2>&1
+        if test $? -ne 0
+        then
+          echo "$1: autoregen.sh [$tmp/$1-regen.log]" >> $ERROR_LOG
+          cd ..
+          return $ERROR_RETURN
+        fi
+        echo "+ $1: autoregen.sh done"
+      else
+        echo "+ $1: autogen.sh"
+        ./autogen.sh > "$tmp/$1-gen.log" 2>&1
+        if test $? -ne 0
+        then
+          echo "$1: autogen.sh [$tmp/$1-gen.log]" >> $ERROR_LOG
+          cd ..
+          return $ERROR_RETURN
+        fi
+        echo "+ $1: autogen.sh done"
       fi
-      echo "+ $1: autogen.sh done"
     fi
 
     echo "+ $1: make"
-    make > "$tmp/$1-make.log" 2>&1
+    MAKEFLAGS="-j$CPUCORES $MAKEFLAGS" make > "$tmp/$1-make.log" 2>&1
     if test $? -ne 0
     then
       echo "$1: make [$tmp/$1-make.log]" >> $ERROR_LOG
@@ -120,6 +124,7 @@ if test -e $ERROR_LOG;  then
   echo
   cat $ERROR_LOG
 else
+  echo "Update done"
   rm -rf "$tmp"
 fi
 exit
@@ -135,7 +140,7 @@ for m in $CORE; do
 done
 
 # build other modules in parallel
-for m in $MODULES; do
+for m in $MODULES $EXTRA_MODULES; do
   build $m &
   PIDS="$PIDS $!"
 done