net/mwan3: add hotplug script for hidden self interface generation
[feed/packages.git] / .travis_do.sh
index f2fc9c6038bfe440bec8517327bcfbf63626dfc1..683dab79fe2dde77089925d6c9e2c55696b13f09 100755 (executable)
@@ -55,15 +55,14 @@ download_sdk() {
 }
 
 # test_package will run on the `script` step.
-# test_package call make download check for very new/modified package in it's
-# own clean sdk directory
-test_packages() {
+# test_package call make download check for very new/modified package
+test_packages2() {
        # search for new or modified packages. PKGS will hold a list of package like 'admin/muninlite admin/monit ...'
-       PKGS=$(git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
+       PKGS=$(git diff --diff-filter=d --name-only "$TRAVIS_COMMIT_RANGE" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
 
        if [ -z "$PKGS" ] ; then
-               echo_blue "No new or modified packages found!" >&2
-               exit 0
+               echo_blue "No new or modified packages found!"
+               return 0
        fi
 
        echo_blue "=== Found new/modified packages:"
@@ -101,7 +100,7 @@ EOF
                echo_blue "=== $pkg_name Finished package"
        done
 
-       exit $RET
+       return $RET
 }
 
 test_commits() {
@@ -122,7 +121,7 @@ test_commits() {
                fi
 
                subject="$(git show -s --format=%s $commit)"
-               if echo "$subject" | grep -q '^[0-9A-Za-z,]\+: '; then
+               if echo "$subject" | grep -q '^[0-9A-Za-z,/-]\+: '; then
                        echo_green "Commit subject line seems ok ($subject)"
                else
                        echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
@@ -139,14 +138,22 @@ test_commits() {
                fi
        done
 
-       exit $RET
+       return $RET
+}
+
+test_packages() {
+       GRET=0
+       test_commits   || GRET=1
+       test_packages2 || GRET=1
+       return $GRET
 }
 
 echo_blue "=== Travis ENV"
 env
 echo_blue "=== Travis ENV"
 
-until git merge-base ${TRAVIS_COMMIT_RANGE/.../ } > /dev/null; do
+until [ "$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ]; do
+       # if clone depth is too small, git rev-list / diff return incorrect results
        echo_blue "Fetching 50 commits more"
        git fetch origin --deepen=50
 done