2018-11-06 20:11:40 +03:00
|
|
|
#!/bin/bash
|
2012-01-13 05:38:39 +04:00
|
|
|
# Usage: sh update.sh <upstream_src_directory>
|
2018-11-06 20:11:40 +03:00
|
|
|
|
2012-01-13 05:38:39 +04:00
|
|
|
set -e
|
|
|
|
|
2018-11-06 20:11:40 +03:00
|
|
|
[[ -n "$1" ]] || ( echo "syntax: $0 update_src_directory"; exit 1 )
|
|
|
|
[[ -e "$1/src/cubeb.c" ]] || ( echo "$1: cubeb not found"; exit 1 )
|
|
|
|
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/AUTHORS .
|
|
|
|
cp $1/LICENSE .
|
|
|
|
cp $1/README.md .
|
2012-01-13 05:38:39 +04:00
|
|
|
cp $1/include/cubeb/cubeb.h include
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/android/sles_definitions.h src/android
|
2013-03-08 08:51:59 +04:00
|
|
|
cp $1/src/cubeb-internal.h src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb-speex-resampler.h src
|
|
|
|
cp $1/src/cubeb.c src
|
2020-11-03 19:01:59 +03:00
|
|
|
cp $1/src/cubeb_aaudio.cpp src
|
2012-01-13 05:38:39 +04:00
|
|
|
cp $1/src/cubeb_alsa.c src
|
2017-03-14 20:57:03 +03:00
|
|
|
cp $1/src/cubeb_array_queue.h src
|
2016-07-20 16:02:23 +03:00
|
|
|
cp $1/src/cubeb_audiounit.cpp src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb_jack.cpp src
|
2017-03-14 20:57:03 +03:00
|
|
|
cp $1/src/cubeb_log.cpp src
|
|
|
|
cp $1/src/cubeb_log.h src
|
|
|
|
cp $1/src/cubeb_mixer.cpp src
|
|
|
|
cp $1/src/cubeb_mixer.h src
|
2012-10-23 08:22:10 +04:00
|
|
|
cp $1/src/cubeb_opensl.c src
|
2020-11-03 19:01:59 +03:00
|
|
|
cp $1/src/cubeb_android.h src
|
2018-02-27 14:37:49 +03:00
|
|
|
cp $1/src/cubeb-jni.cpp src
|
|
|
|
cp $1/src/cubeb-jni.h src
|
|
|
|
cp $1/src/android/cubeb-output-latency.h src/android
|
|
|
|
cp $1/src/android/cubeb_media_library.h src/android
|
2020-10-20 23:03:31 +03:00
|
|
|
cp $1/src/cubeb_oss.c src
|
2017-03-14 20:57:03 +03:00
|
|
|
cp $1/src/cubeb_osx_run_loop.h src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb_resampler.cpp src
|
2016-01-22 06:17:46 +03:00
|
|
|
cp $1/src/cubeb_resampler.h src
|
2016-03-25 19:43:02 +03:00
|
|
|
cp $1/src/cubeb_resampler_internal.h src
|
|
|
|
cp $1/src/cubeb_ring_array.h src
|
2017-03-14 20:57:03 +03:00
|
|
|
cp $1/src/cubeb_ringbuffer.h src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb_sndio.c src
|
2017-09-01 18:39:06 +03:00
|
|
|
cp $1/src/cubeb_strings.c src
|
|
|
|
cp $1/src/cubeb_strings.h src
|
2019-06-27 19:59:00 +03:00
|
|
|
cp $1/src/cubeb_sun.c src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb_utils.h src
|
2018-03-19 18:22:26 +03:00
|
|
|
cp $1/src/cubeb_utils.cpp src
|
2016-07-29 14:40:52 +03:00
|
|
|
cp $1/src/cubeb_utils_unix.h src
|
|
|
|
cp $1/src/cubeb_utils_win.h src
|
2016-06-15 19:26:54 +03:00
|
|
|
cp $1/src/cubeb_wasapi.cpp src
|
|
|
|
cp $1/src/cubeb_winmm.c src
|
2016-11-11 05:01:56 +03:00
|
|
|
cp $1/test/common.h gtest
|
|
|
|
cp $1/test/test_audio.cpp gtest
|
|
|
|
cp $1/test/test_devices.cpp gtest
|
|
|
|
cp $1/test/test_duplex.cpp gtest
|
|
|
|
cp $1/test/test_latency.cpp gtest
|
2017-12-05 21:08:20 +03:00
|
|
|
cp $1/test/test_loopback.cpp gtest
|
2017-03-14 20:57:03 +03:00
|
|
|
cp $1/test/test_overload_callback.cpp gtest
|
2016-11-11 05:01:56 +03:00
|
|
|
cp $1/test/test_record.cpp gtest
|
|
|
|
cp $1/test/test_resampler.cpp gtest
|
|
|
|
cp $1/test/test_ring_array.cpp gtest
|
|
|
|
cp $1/test/test_sanity.cpp gtest
|
|
|
|
cp $1/test/test_tone.cpp gtest
|
|
|
|
cp $1/test/test_utils.cpp gtest
|
2014-02-25 17:21:59 +04:00
|
|
|
|
2012-01-13 05:38:39 +04:00
|
|
|
if [ -d $1/.git ]; then
|
|
|
|
rev=$(cd $1 && git rev-parse --verify HEAD)
|
2017-02-27 22:53:41 +03:00
|
|
|
date=$(cd $1 && git show -s --format=%ci HEAD)
|
2012-01-13 05:38:39 +04:00
|
|
|
dirty=$(cd $1 && git diff-index --name-only HEAD)
|
2018-11-06 20:11:40 +03:00
|
|
|
set +e
|
|
|
|
pre_rev=$(grep -o '[[:xdigit:]]\{40\}' moz.yaml)
|
2018-10-31 12:58:01 +03:00
|
|
|
commits=$(cd $1 && git log --pretty=format:'%h - %s' $pre_rev..$rev)
|
2018-11-06 20:11:40 +03:00
|
|
|
set -e
|
2012-01-13 05:38:39 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$rev" ]; then
|
|
|
|
version=$rev
|
|
|
|
if [ -n "$dirty" ]; then
|
|
|
|
version=$version-dirty
|
|
|
|
echo "WARNING: updating from a dirty git repository."
|
|
|
|
fi
|
2018-11-06 20:11:40 +03:00
|
|
|
sed -i.bak -e "s/^ *release:.*/ release: \"$version ($date)\"/" moz.yaml
|
|
|
|
if [[ ! "$( grep "$version" moz.yaml )" ]]; then
|
|
|
|
echo "Updating moz.yaml failed."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
rm moz.yaml.bak
|
|
|
|
[[ -n "$commits" ]] && echo -e "Pick commits:\n$commits"
|
2012-01-13 05:38:39 +04:00
|
|
|
else
|
2018-11-06 20:11:40 +03:00
|
|
|
echo "Remember to update moz.yaml with the version details."
|
2012-01-13 05:38:39 +04:00
|
|
|
fi
|