3 # This script will update all the modules listed below so that
4 # common points to master in the common module.
6 # If you have many of the GStreamer modules checked out in a particular
7 # directory, it's best to run this script from that directory. For
8 # example, I check everything out in ~/gst, so this file is
9 # ~/gst/common/update-common. To do an update, I do
10 # 'cd ~/gst ; ./common/update-common'. This will automatically use
11 # the refs in your existing checkout when cloning the temporary
12 # checkout. Alternatively, you can use the reference variable below.
15 # Set this variable to point to any directory containing existing
16 # git # checkouts, and git will pull objects from there, decreasing
24 modules="gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad \
25 gst-plugins-ugly gst-ffmpeg gst-python \
26 gnonlin gst-plugins-gl gst-rtsp-server gst-editing-services"
29 dir=`mktemp -d $topdir/common-update-XXXXXX`
31 for module in $modules
34 if test -e $reference/$module/.git ; then
35 git clone --reference $reference/$module/.git --shared ssh://git.freedesktop.org/git/gstreamer/$module
36 elif test -e $topdir/$module/.git ; then
37 git clone --reference $topdir/$module/.git --shared ssh://git.freedesktop.org/git/gstreamer/$module
39 git clone ssh://git.freedesktop.org/git/gstreamer/$module
43 # ignore modules that don't have such a branch
44 if ! git show-ref origin/$BRANCH >/dev/null; then
48 git checkout -b $BRANCH origin/$BRANCH
51 cd $dir/$module/common
52 ref_from=`git log --pretty=format:%h -n 1 HEAD`
53 git checkout -b $BRANCH origin/$BRANCH
55 ref_to=`git log --pretty=format:%h -n 1 HEAD`
56 echo updating common from $ref_from to $ref_to
57 if [ "$ref_from" != "$ref_to" ] ; then
60 git commit -m "Automatic update of common submodule
62 From $ref_from to $ref_to"
67 for module in $modules
70 if git show-ref origin/$BRANCH >/dev/null; then
71 git push origin $BRANCH