]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - .travis-functions.sh
libmount: don't use sscanf() for swaps parsing
[thirdparty/util-linux.git] / .travis-functions.sh
index db50f0997db7a2115495dcd0a777ea4278e863d1..684c20588d9c2349517f53e10b110bd0c031c519 100755 (executable)
@@ -17,8 +17,15 @@ MAKE="make -j2"
 DUMP_CONFIG_LOG="short"
 export TS_OPT_parsable="yes"
 
+# workaround ugly warning on travis OSX,
+# see https://github.com/direnv/direnv/issues/210
+shell_session_update() { :; }
+
 function xconfigure
 {
+       which "$CC"
+       "$CC" --version
+
        ./configure "$@" $OSX_CONFOPTS
        err=$?
        if [ "$DUMP_CONFIG_LOG" = "short" ]; then
@@ -29,12 +36,24 @@ function xconfigure
        return $err
 }
 
+# TODO: integrate checkusage into our regular tests and remove this function
+function make_checkusage
+{
+       local tmp
+       if ! tmp=$($MAKE checkusage 2>&1) || test -n "$tmp"; then
+               echo "$tmp"
+               echo "make checkusage failed" >&2
+               return 1
+       fi
+}
+
 function check_nonroot
 {
        local opts="$MAKE_CHECK_OPTS --show-diff"
 
        xconfigure \
                --disable-use-tty-group \
+               --disable-makeinstall-chown \
                --enable-all-programs \
                || return
        $MAKE || return
@@ -42,12 +61,14 @@ function check_nonroot
        osx_prepare_check
        $MAKE check TS_OPTS="$opts" || return
 
+       make_checkusage || return
+
        $MAKE install DESTDIR=/tmp/dest || return
 }
 
 function check_root
 {
-       local opts="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
+       local opts="$MAKE_CHECK_OPTS --show-diff"
 
        xconfigure \
                --enable-all-programs \
@@ -58,7 +79,11 @@ function check_root
        osx_prepare_check
        sudo -E $MAKE check TS_OPTS="$opts" || return
 
-       sudo $MAKE install || return
+       # root on osx has not enough permission for make install ;)
+       [ "$TRAVIS_OS_NAME" = "osx" ] && return
+
+       # keep PATH to make sure sudo would find $CC
+       sudo env "PATH=$PATH" $MAKE install || return
 }
 
 function check_dist
@@ -75,8 +100,8 @@ function travis_install_script
                return
        fi
 
-       # install some packages from Ubuntu's default sources
-       sudo apt-get -qq update
+       # install required packages
+       sudo apt-get -qq update --fix-missing
        sudo apt-get install -qq >/dev/null \
                bc \
                btrfs-tools \
@@ -101,7 +126,6 @@ function travis_install_script
 function osx_install_script
 {
        brew update >/dev/null
-       brew tap homebrew/dupes
 
        brew install gettext ncurses socat xz
        brew link --force gettext