Update ABI tracker script
[openjpeg.git] / tools / travis-ci / abi-check.sh
index 538ae57fdb9a815ae8a3a2aaf998c75b53896a1c..2a50ce49e5a2c70fac5018378a0883132b900116 100755 (executable)
@@ -14,8 +14,13 @@ if [ "${OPJ_CI_ABI_CHECK:-}" != "1" ]; then
 fi
 
 OPJ_UPLOAD_ABI_REPORT=0
-OPJ_LATEST_VERSION="2.1"
-OPJ_LIMIT_ABI_BUILDS="-limit 2"
+#OPJ_PREVIOUS_VERSION="2.1"
+OPJ_LATEST_VERSION="2.1.1"
+if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
+       OPJ_LIMIT_ABI_BUILDS="-limit 3"
+else
+       OPJ_LIMIT_ABI_BUILDS="-limit 2"
+fi
 OPJ_REPO="https://github.com/uclouvain/openjpeg.git"
 OPJ_SSH_REPO=${OPJ_REPO/https:\/\/github.com\//git@github.com:}
 OPJ_UPLOAD_BRANCH="gh-pages"
@@ -59,12 +64,10 @@ export PATH=${PWD}/tools/abi-tracker/bin:$PATH
 mkdir work
 cd work
 
-# If upload is scheduled, clone the gh-pages branch and work from there
-if [ ${OPJ_UPLOAD_ABI_REPORT} -eq 1 ]; then
-       git clone -b $OPJ_UPLOAD_BRANCH --single-branch $OPJ_REPO .
-       cd $OPJ_UPLOAD_DIR
-       rm -rf installed/openjpeg/current/*
-fi
+# Clone the gh-pages branch and work from there
+git clone -b $OPJ_UPLOAD_BRANCH --single-branch $OPJ_REPO .
+cd $OPJ_UPLOAD_DIR
+rm -rf installed/openjpeg/current/*
 
 # Let's create all we need
 grep -v Git ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
@@ -83,10 +86,16 @@ EXIT_CODE=0
 
 # Check API
 abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
+if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
+       abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_PREVIOUS_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
+fi
 
 # Check ABI
 if [ "${OPJ_LIMIT_ABI_BUILDS}" != "" ]; then
        abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
+       if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
+               abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_PREVIOUS_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
+       fi
 else
        echo "Disable ABI check for now, problems with symbol visibility..."
 fi
@@ -98,9 +107,6 @@ if [ ${OPJ_UPLOAD_ABI_REPORT} -eq 1 ]; then
        git config user.name "OpenJPEG Travis CI"
        git config user.email "info@openjpeg.org"
 
-       # Commit the "changes", i.e. the new version.
-       # The delta will show diffs between new and old versions.
-       git diff > ../diff.patch
        git add .
        git commit -m "Update ABI/API compatibility reports after commit ${TRAVIS_COMMIT:-}"