summaryrefslogtreecommitdiff
path: root/debian/ada/check_ali_update.sh
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-11-18 15:53:29 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-11-18 15:53:29 +0300
commit8f6c4b0033c72f8ac14694c419a99458339dd6a9 (patch)
tree06c106e622a58100aa85a381b9b65d222b076df4 /debian/ada/check_ali_update.sh
parent42156b5190f4fa150e1fab6777eb81e69d4db8c9 (diff)
downloadgcc-9-debian.tar.gz
Import gcc-9 (9.2.1-19)debian/9.2.1-19debian
Diffstat (limited to 'debian/ada/check_ali_update.sh')
-rw-r--r--debian/ada/check_ali_update.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/debian/ada/check_ali_update.sh b/debian/ada/check_ali_update.sh
new file mode 100644
index 0000000..4067341
--- /dev/null
+++ b/debian/ada/check_ali_update.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Helper for debian/rules2.
+
+# A modification of libgnat sources invalidates the .ali checksums in
+# reverse dependencies as described in the Debian Policy for Ada. GCC
+# cannot afford the recommended passage through NEW, but this check at
+# least reports the issue before causing random FTBFS.
+
+set -Cefu
+[$# = 2]
+# Argument 1: old ALI dir
+# Argument 2: new ALI dir
+
+# A missing $1 means that we build a new GCC Base Version, and that
+# libgnatBV-dev package will be renamed anyway.
+[-d "$1"] || exit 0
+
+report () {
+ echo 'error: changes in Ada Library Information files.'
+ echo 'You are seeing this because'
+ echo ' * DEB_CHECK_ALI_UPDATE=1 in the environment.'
+ echo ' * build_type=build-native and with_libgnat=yes in debian/rules.defs.'
+ echo " * $1 exists, so libgnat is probably rebuilding itself with the same version."
+ echo " * checksums in former $1 and freshly built $2 differ."
+ echo 'This may break Ada packages, see https://people.debian.org/~lbrenta/debian-ada-policy.html.'
+ echo 'If you are uploading to Debian, please contact debian-ada@lists.debian.org.'
+ exit 1
+}
+
+for ali1 in `find "$1" -name "*.ali"`; do
+ unit=`basename "$ali1" .ali`
+ ali2="$2/$unit.ali"
+
+ [-r "$ali2"] || report "$ali1" "$ali2"
+
+ pattern="^D $unit\.ad"
+ lines1=`grep "$pattern" "$ali1"`
+ lines2=`grep "$pattern" "$ali2"`
+ ["$lines1" = "lines2"] || report "$ali1" "$ali2"
+done