media/update-libjpeg.sh
author Eric Faust <efaustbmo@gmail.com>
Thu, 08 Oct 2015 21:07:47 -0700
changeset 300408 4fed2969228466303141ed72f29cba5d123ea079
parent 299801 8543b8749c4e20418ea17649088324e264ff4d18
child 325851 d8190cbce7b0b188ec678da1a1ec1a190c5da636
permissions -rwxr-xr-x
Bug 1141863 - Followfollowfollowup: Remove redundant assert causing rooting hazards. (r=Waldo over IRC) CLOSED TREE

#!/bin/sh

set -v -e -x

if [ $# -lt 1 ]; then
  echo "Usage: update-libjpeg.sh /path/to/libjpeg-turbo/ [tag]"
  exit 1
fi

srcdir=`realpath $(dirname $0)`
topsrcdir=${srcdir}/..
rm -rf $srcdir/libjpeg

repo=$1
tag=${2-HEAD}

(cd $repo; git archive --prefix=media/libjpeg/ $tag) | (cd $srcdir/..; tar xf -)

cd $srcdir/libjpeg
cp win/jsimdcfg.inc simd/

revert_files="jconfig.h jconfigint.h moz.build Makefile.in MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
if test -d ${topsrcdir}/.hg; then
    hg revert --no-backup $revert_files
elif test -d ${topsrcdir}/.git; then
    git checkout HEAD -- $revert_files
fi

patch -p0 -i mozilla.diff