Update scripts/cvs-update.sh to git-update.sh; add git-version.sh
[platform/upstream/gstreamer.git] / scripts / git-update.sh
1 #!/bin/bash
2
3 # update all known gstreamer modules
4 # build them one by one
5 # report failures at the end
6 # run this from a directory that contains the checkouts for each of the
7 # modules
8
9 FAILURE=
10
11 MODULES="\
12     gstreamer gst-plugins-base \
13     gst-plugins-good gst-plugins-ugly gst-plugins-bad \
14     gst-ffmpeg \
15     gst-python \
16     gnonlin"
17
18 for m in $MODULES; do
19   if test -d $m; then
20     echo "+ updating $m"
21     cd $m
22
23     git pull origin master
24     if test $? -ne 0
25     then
26       git stash
27       git pull origin master
28       if test $? -ne 0
29       then 
30         git stash apply
31         FAILURE="$FAILURE$m: update\n"
32       else
33         git stash apply
34       fi
35       cd ..
36       continue
37     fi
38     git submodule update
39     if test $? -ne 0
40     then
41       FAILURE="$FAILURE$m: update\n"
42       cd ..
43       continue
44     fi
45     cd ..
46   fi
47 done
48
49 # then build
50 for m in $MODULES; do
51   if test -d $m; then
52     cd $m
53     if test ! -e Makefile
54     then
55       ./autoregen.sh
56       if test $? -ne 0
57       then
58         FAILURE="$FAILURE$m: autoregen.sh\n"
59         cd ..
60         continue
61       fi
62     fi
63
64     make $@
65     if test $? -ne 0
66     then
67       FAILURE="$FAILURE$m: make\n"
68       cd ..
69       continue
70     fi
71
72     make $@ check
73     if test $? -ne 0
74     then
75       FAILURE="$FAILURE$m: check\n"
76       cd ..
77       continue
78     fi
79     cd ..
80   fi
81 done
82
83 if test "x$FAILURE" != "x";  then
84   echo "Failures:"
85   echo
86   echo -e $FAILURE
87 fi