2015-10-05 16:31:36 +03:00
|
|
|
#!/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
|
|
|
|
|
2021-09-14 00:55:12 +03:00
|
|
|
revert_files="jconfig.h jconfigint.h moz.build MOZCHANGES mozilla.diff"
|
2015-10-05 16:31:36 +03:00
|
|
|
if test -d ${topsrcdir}/.hg; then
|
|
|
|
hg revert --no-backup $revert_files
|
2021-09-14 00:55:12 +03:00
|
|
|
elif test -e ${topsrcdir}/.git; then
|
2015-10-05 16:31:36 +03:00
|
|
|
git checkout HEAD -- $revert_files
|
|
|
|
fi
|
|
|
|
|
|
|
|
patch -p0 -i mozilla.diff
|