diff mbox

[trusty/lts-backport-utopic-next,3/3] UBUNTU: [Debian] rebuild should only trigger for non-linux packages

Message ID 1447696050-21914-6-git-send-email-apw@canonical.com
State New
Headers show

Commit Message

Andy Whitcroft Nov. 16, 2015, 5:47 p.m. UTC
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(+)
diff mbox

Patch

diff --git a/debian/tests/rebuild b/debian/tests/rebuild
index 8a99850..6f73b36c 100644
--- a/debian/tests/rebuild
+++ b/debian/tests/rebuild
@@ -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