#!/bin/bash
+export LC_ALL=C.UTF-8
+
if [ "$#" != "2" ]; then
echo "Usage: $0 <release> <revision>" 1>&2
exit 1
ver=$1
revision=$2
-abi=$(echo $revision | gawk -F. '{print $1}')
+abi=$(echo $revision | sed -r -e 's/([^\+~]*)\.[^\.]+(~.*)?(\+.*)?$/\1/')
verabi=$ver-$abi
verfull=$ver-$revision
. $DEBIAN/etc/getabis
-compilers=`cat $abidir/*/*.compiler | sort -u | wc -l`
+# Extract compiler source package version from e.g.:
+# GCC: (Ubuntu/Linaro 4.8.2-19ubuntu1) 4.8.2
+compilers=`sed 's/^.*(.* \(.*\)).*$/\1/' $abidir/*/*.compiler | sort -u | wc -l`
if [ "$compilers" != 1 ]; then
- echo "WARNING: inconsistant compiler versions detected" 1>&2
+ echo "WARNING: inconsistent compiler versions detected:" 1>&2
+ sort -u $abidir/*/*.compiler | sed 's/^/WARNING: /' 1>&2
fi
sort < $fwinfo | uniq > fwinfo.tmp
rmdir $tmpdir
-# Add the new ABI directory, remove the old
-git add $abidir
-find $DEBIAN/abi/* -maxdepth 0 -type d | grep -v $verfull | while read f; do git rm -r $f;done
+# If this is running in a git repo, add the new ABI directory, remove the old
+if [ -d ".git" ]; then
+ git add $abidir
+ find $DEBIAN/abi/* -maxdepth 0 -type d | grep -v $verfull | while read f; do git rm -r $f;done
+fi