+ [ $RET -ne 0 ] && return $RET
+
+ for pkg_dir in $PKGS ; do
+ pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
+ echo_blue "=== $pkg_name: Starting compile test"
+
+ # we can't enable verbose built else we often hit Travis limits
+ # on log size and the job get killed
+ exec_status '^ERROR' make "package/$pkg_name/compile" -j3 || RET=1
+
+ echo_blue "=== $pkg_name: compile test done"
+
+ echo_blue "=== $pkg_name: begin compile logs"
+ for f in $(find logs/package/feeds/packages/$pkg_name/ -type f); do
+ echo_blue "Printing $f"
+ cat "$f"
+ done
+ echo_blue "=== $pkg_name: end compile logs"
+
+ echo_blue "=== $pkg_name: begin packages sizes"
+ du -ba bin/
+ echo_blue "=== $pkg_name: end packages sizes"
+ done
+
+ return $RET
+}
+
+test_commits() {
+ RET=0
+ for commit in $(git rev-list ${TRAVIS_COMMIT_RANGE/.../..}); do
+ echo_blue "=== Checking commit '$commit'"
+ if git show --format='%P' -s $commit | grep -qF ' '; then
+ echo_red "Pull request should not include merge commits"
+ RET=1
+ fi
+
+ author="$(git show -s --format=%aN $commit)"
+ if echo $author | grep -q '\S\+\s\+\S\+'; then
+ echo_green "Author name ($author) seems ok"
+ else
+ echo_red "Author name ($author) need to be your real name 'firstname lastname'"
+ RET=1
+ fi
+
+ subject="$(git show -s --format=%s $commit)"
+ if echo "$subject" | grep -q -e '^[0-9A-Za-z,/-]\+: ' -e '^Revert '; then
+ echo_green "Commit subject line seems ok ($subject)"
+ else
+ echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
+ RET=1
+ fi
+
+ body="$(git show -s --format=%b $commit)"
+ sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
+ if echo "$body" | grep -qF "$sob"; then
+ echo_green "Signed-off-by match author"
+ else
+ echo_red "Signed-off-by is missing or doesn't match author (should be '$sob')"
+ RET=1
+ fi
+ done
+
+ return $RET
+}
+
+test_packages() {
+ test_commits && test_packages2 || return 1