gecko/media/libstagefright/checkout.sh
Anthony Jones 0caa8d383f Bug 908503: Change to stagefright demuxer; r=cpearce
Bug 908503: Build config changes for libstagefright demuxer; r=glandium
Bug 908503: Remove Chrome demuxer; r=cpearce
Bug 908503: Add conversion to Annex B; r=cpearce
2014-05-22 14:42:39 +12:00

53 lines
1.2 KiB
Bash
Executable File

#!/bin/bash -e
set -o pipefail
abort () {
errcode=$?
echo "Error: That didn't work..."
exit $errcode
}
trap abort ERR
cd `dirname "$0"`
SITE=https://android.googlesource.com/platform
for TAGFILE in `find patches -name \*.tag`
do
REPO=${TAGFILE:8:-4}
DEST=android/${REPO}
if [[ ! -e ${DEST} ]]
then
mkdir -p `dirname ${DEST}`
echo Cloning from ${SITE}/${REPO}
git clone ${SITE}/${REPO} ${DEST}
fi
rm -fR ${REPO}
TAG=`cat $TAGFILE`
(cd $DEST && git reset --hard 2>&1 && git checkout ${TAG} 2>&1) > /dev/null
done
FILES=`python files.py`
HEADERS=`cat additional_headers`
for FILE in $FILES $HEADERS frameworks/av/media/libstagefright/include/AMRExtractor.h
do
echo Copying ${FILE}
mkdir -p `dirname ${FILE}`
cp android/${FILE} ${FILE}
done
for PATCH in `find patches -name \*.patch`
do
REPO=${PATCH:8:-6}
echo Patching repo ${REPO}
for FILE in `grep -- '--- a/' ${PATCH} | colrm 1 6`
do
if [[ ! -e ${FILE} ]]
then
echo Copying ${REPO}/${FILE}
mkdir -p `dirname ${REPO}/${FILE}`
cp android/${REPO}/${FILE} ${REPO}/${FILE}
fi
done
(cd ${REPO} && patch -p1 || true) < $PATCH
done