@@ -1,3 +1,20 @@
#!/bin/sh
+
+# If we are triggering for just linux or linux-meta we know we have
+# just built the kernel and there is no point in repeating that
+# build, it just wastes time. (LP: #1498862)
+build_needed=0
+for trigger in ${ADT_TEST_TRIGGERS:-force}
+do
+ case "$trigger" in
+ linux/*|linux-lts-*/*|linux-meta*/*) ;;
+ *) build_needed=1 ;;
+ esac
+done
+if [ "$build_needed" -eq 0 ]; then
+ echo "rebuild: short circuiting build for '${ADT_TEST_TRIGGERS}'"
+ exit 0
+fi
+
set -e
dpkg-buildpackage -rfakeroot -us -uc -b
BugLink: http://bugs.launchpad.net/bugs/1498862 BugLink: http://bugs.launchpad.net/bugs/1516686 Signed-off-by: Andy Whitcroft <apw@canonical.com> --- debian/tests/rebuild | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)