代码拉取完成,页面将自动刷新
#!/bin/bash
TMPDIR=$(mktemp -d)
PKG="bsdiff"
LIB="libbsdiff"
OLDVERSION=$(git tag -l 'v*' | sort -t . -k 1.2,1n -k 2,2n -k 3,3n | tail -1)
NEWVERSION="HEAD"
OLDCOMMIT=$(git rev-list -n 1 --abbrev-commit ${OLDVERSION})
NEWCOMMIT=$(git rev-list -n 1 --abbrev-commit ${NEWVERSION})
do_build() {
local commit=$1
echo "Building ${PKG} at commit ${commit}..."
git archive \
-o "${TMPDIR}/${PKG}-${commit}.tar.gz" \
--prefix="${PKG}-${commit}/" ${commit}
(
pushd "${TMPDIR}"
tar xf ${PKG}-${commit}.tar.gz
pushd ${PKG}-${commit}
./autogen.sh
make
popd
popd
) &> /dev/null
}
create_xml_desc() {
local commit=$1
cat > ${TMPDIR}/${PKG}-${commit}.xml << EOF
<version>
${commit}
</version>
<headers>
${TMPDIR}/${PKG}-${commit}/include/bsdiff.h
</headers>
<libs>
${TMPDIR}/${PKG}-${commit}/.libs
</libs>
EOF
}
bump_current() {
local current=$(grep '^LIBBSDIFF_CURRENT' Makefile.am | cut -d'=' -f2)
current=$(expr $current + 1)
sed -i "s/^\(LIBBSDIFF_CURRENT=\).*$/\1$current/" Makefile.am
# Note: the REVISION and AGE fields are not modified at all right now, but
# when logic is implemented in the future according to the libtool algorithm,
# they must be reset to zero, as below.
sed -i "s/^\(LIBBSDIFF_REVISION=\).*$/\10/" Makefile.am
sed -i "s/^\(LIBBSDIFF_AGE=\).*$/\10/" Makefile.am
git add Makefile.am
git commit -s -m "Bump $LIB major version to $current"
}
do_build ${OLDCOMMIT}
do_build ${NEWCOMMIT}
create_xml_desc ${OLDCOMMIT}
create_xml_desc ${NEWCOMMIT}
abi-compliance-checker \
-lib ${LIB} \
-report-path ${TMPDIR}/reports/${OLDCOMMIT}_to_${NEWCOMMIT}/report.xml \
-log1-path ${TMPDIR}/logs/${OLDCOMMIT}.log \
-log2-path ${TMPDIR}/logs/${NEWCOMMIT}.log \
-old ${TMPDIR}/${PKG}-${OLDCOMMIT}.xml \
-new ${TMPDIR}/${PKG}-${NEWCOMMIT}.xml \
-xml
ret=$?
if [ $ret -eq 0 ]; then
# TODO: should bump AGE and CURRENT for backward-compatible library changes,
# and REVISION for any library code changes.
echo "No compatibility errors found!"
elif [ $ret -eq 1 ]; then
echo "Incompatibilities found; bumping lib version."
bump_current
elif [ $ret -gt 1 ]; then
echo "Problem running the ABI check tool: error code ${ret}."
fi
exit $ret
# vi: ts=8 sw=2 sts=2 et tw=80
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。