2018-01-19 03:59:58 +08:00
|
|
|
# Usage: sh update.sh <upstream_src_directory>
|
|
|
|
|
cp $1/include/nestegg/nestegg.h include
|
|
|
|
|
cp $1/src/nestegg.c src
|
|
|
|
|
cp $1/LICENSE .
|
|
|
|
|
cp $1/README.md .
|
|
|
|
|
cp $1/AUTHORS .
|
2022-06-30 10:31:31 +08:00
|
|
|
|
|
|
|
|
# Patch the imported files.
|
|
|
|
|
patch -p1 < mcp-avcaacsupport.patch
|
|
|
|
|
|
2018-01-19 03:59:58 +08:00
|
|
|
if [ -d $1/.git ]; then
|
|
|
|
|
rev=$(cd $1 && git rev-parse --verify HEAD)
|
|
|
|
|
dirty=$(cd $1 && git diff-index --name-only HEAD)
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -n "$rev" ]; then
|
|
|
|
|
version=$rev
|
|
|
|
|
if [ -n "$dirty" ]; then
|
|
|
|
|
version=$version-dirty
|
|
|
|
|
echo "WARNING: updating from a dirty git repository."
|
|
|
|
|
fi
|
2018-09-28 22:55:06 -05:00
|
|
|
sed -i "/The git commit ID used was/ s/[0-9a-f]\+\(-dirty\)\?\./$version./" README_MCP
|
2018-01-19 03:59:58 +08:00
|
|
|
else
|
2018-09-28 22:55:06 -05:00
|
|
|
echo "Remember to update README_MCP with the version details."
|
2018-01-19 03:59:58 +08:00
|
|
|
fi
|
|
|
|
|
|