2005-10-16 12:37:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# update all known gstreamer modules
|
|
|
|
# build them one by one
|
|
|
|
# report failures at the end
|
|
|
|
# run this from a directory that contains the checkouts for each of the
|
|
|
|
# modules
|
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
PIDS=
|
2005-10-16 12:37:14 +00:00
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
CORE="\
|
|
|
|
gstreamer gst-plugins-base"
|
2009-06-13 12:53:24 +00:00
|
|
|
MODULES="\
|
|
|
|
gst-plugins-good gst-plugins-ugly gst-plugins-bad \
|
2013-04-02 22:18:42 +00:00
|
|
|
gst-libav"
|
|
|
|
EXTRA_MODULES="\
|
|
|
|
gst-editing-services \
|
|
|
|
gst-rtsp-server \
|
2015-01-20 08:19:10 +00:00
|
|
|
gst-python"
|
2009-06-13 12:53:24 +00:00
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
tmp=${TMPDIR-/tmp}
|
|
|
|
tmp=$tmp/git-update.$(date +%Y%m%d-%H%M-).$RANDOM.$RANDOM.$RANDOM.$$
|
|
|
|
|
|
|
|
(umask 077 && mkdir "$tmp") || {
|
|
|
|
echo "Could not create temporary directory! Exiting." 1>&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
ERROR_LOG="$tmp/failures.log"
|
2010-03-12 13:33:00 +00:00
|
|
|
ERROR_RETURN=255
|
2010-01-28 06:27:49 +00:00
|
|
|
|
2016-05-19 14:27:36 +00:00
|
|
|
CPUCORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo "1")
|
|
|
|
|
2013-04-02 22:18:42 +00:00
|
|
|
for m in $CORE $MODULES $EXTRA_MODULES; do
|
2005-10-16 12:37:14 +00:00
|
|
|
if test -d $m; then
|
2009-06-13 12:53:24 +00:00
|
|
|
echo "+ updating $m"
|
2005-10-16 12:37:14 +00:00
|
|
|
cd $m
|
2009-06-13 12:53:24 +00:00
|
|
|
|
2014-07-22 18:45:17 +00:00
|
|
|
git pull --rebase
|
2009-06-13 12:53:24 +00:00
|
|
|
if test $? -ne 0
|
|
|
|
then
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "$m: update (trying stash, pull, stash apply)" >> $ERROR_LOG
|
2009-06-13 12:53:24 +00:00
|
|
|
git stash
|
2014-07-22 18:45:17 +00:00
|
|
|
git pull --rebase
|
2009-06-13 12:53:24 +00:00
|
|
|
if test $? -ne 0
|
|
|
|
then
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "$m: update" >> $ERROR_LOG
|
|
|
|
cd ..
|
|
|
|
continue
|
2009-06-13 12:53:24 +00:00
|
|
|
fi
|
2010-01-28 06:27:49 +00:00
|
|
|
git stash apply
|
2009-06-13 12:53:24 +00:00
|
|
|
fi
|
2010-01-28 06:27:49 +00:00
|
|
|
|
2009-06-13 12:53:24 +00:00
|
|
|
git submodule update
|
2005-10-16 12:37:14 +00:00
|
|
|
if test $? -ne 0
|
|
|
|
then
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "$m: update (submodule)" >> $ERROR_LOG
|
2005-10-16 12:37:14 +00:00
|
|
|
cd ..
|
|
|
|
continue
|
|
|
|
fi
|
2009-06-13 12:53:24 +00:00
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
build()
|
|
|
|
{
|
|
|
|
if test -d $1; then
|
|
|
|
cd $1
|
2010-03-24 12:33:58 +00:00
|
|
|
if test ! -e Makefile
|
2008-06-20 16:29:23 +00:00
|
|
|
then
|
2010-03-24 12:33:58 +00:00
|
|
|
if test -e autoregen.sh
|
2010-03-22 14:06:21 +00:00
|
|
|
then
|
2010-03-24 12:33:58 +00:00
|
|
|
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"
|
2010-03-22 14:06:21 +00:00
|
|
|
fi
|
|
|
|
fi
|
2008-06-20 16:29:23 +00:00
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "+ $1: make"
|
2016-05-19 14:27:36 +00:00
|
|
|
MAKEFLAGS="-j$CPUCORES $MAKEFLAGS" make > "$tmp/$1-make.log" 2>&1
|
2005-10-16 12:37:14 +00:00
|
|
|
if test $? -ne 0
|
|
|
|
then
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "$1: make [$tmp/$1-make.log]" >> $ERROR_LOG
|
2005-10-16 12:37:14 +00:00
|
|
|
cd ..
|
2010-03-12 13:33:00 +00:00
|
|
|
return $ERROR_RETURN
|
2005-10-16 12:37:14 +00:00
|
|
|
fi
|
2010-01-28 06:27:49 +00:00
|
|
|
echo "+ $1: make done"
|
2008-06-20 16:29:23 +00:00
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
if test "x$CHECK" != "x"; then
|
|
|
|
echo "+ $1: make check"
|
|
|
|
make check > "$tmp/$1-check.log" 2>&1
|
|
|
|
if test $? -ne 0
|
|
|
|
then
|
|
|
|
echo "$1: check [$tmp/$1-check.log]" >> $ERROR_LOG
|
|
|
|
cd ..
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
echo "+ $1: make check done"
|
2005-10-16 12:37:14 +00:00
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
fi
|
2010-01-28 06:27:49 +00:00
|
|
|
}
|
2005-10-16 12:37:14 +00:00
|
|
|
|
2010-01-28 06:27:49 +00:00
|
|
|
beach()
|
|
|
|
{
|
|
|
|
if test -e $ERROR_LOG; then
|
2005-10-16 12:37:14 +00:00
|
|
|
echo "Failures:"
|
|
|
|
echo
|
2010-01-28 06:27:49 +00:00
|
|
|
cat $ERROR_LOG
|
|
|
|
else
|
2013-05-28 22:34:54 +00:00
|
|
|
echo "Update done"
|
2010-01-28 06:27:49 +00:00
|
|
|
rm -rf "$tmp"
|
2005-10-16 12:37:14 +00:00
|
|
|
fi
|
2010-03-12 13:33:00 +00:00
|
|
|
exit
|
2010-01-28 06:27:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# build core and base plugins sequentially
|
|
|
|
# exit if build fails (excluding checks)
|
|
|
|
for m in $CORE; do
|
|
|
|
build $m
|
2010-03-12 13:33:00 +00:00
|
|
|
if [ $? -eq $ERROR_RETURN ]; then
|
2010-01-28 06:27:49 +00:00
|
|
|
beach
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# build other modules in parallel
|
|
|
|
for m in $MODULES; do
|
|
|
|
build $m &
|
|
|
|
PIDS="$PIDS $!"
|
|
|
|
done
|
|
|
|
wait $PIDS
|
|
|
|
|
|
|
|
beach
|
|
|
|
|