From 758bf30d2651fade5d17b6100ac65541e5da7bc7 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 18 Aug 2006 14:23:51 +0000 Subject: [PATCH] only build cmake if needed svn path=/trunk/KDE/kdesdk/scripts/kdesvn-build-coverity; revision=574251 --- kdesvn-build-coverity | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/kdesvn-build-coverity b/kdesvn-build-coverity index 33ad3c1..823502e 100644 --- a/kdesvn-build-coverity +++ b/kdesvn-build-coverity @@ -111,6 +111,20 @@ sub download_install_dbus() return 1; } +# This subroutine checks if an appropriate dbus software is already installed. +# Currently this means DBUS 0.62. +# +# Return value is true if DBUS is installed, 0 otherwise. + +sub check_cmake_installed() +{ + my $minVersion = '2.4-patch 3'; + + my $result = system('cmake', '--version'); + + return ($result >> 8) == 0 && ($result =~ $minVersion); +} + # This subroutine downloads CMake if necessary, builds and installs it (all # in one step: there is no separate update then install). # @@ -190,6 +204,8 @@ sub download_install_cmake() return 1; } + + # This subroutine is run after the lock has been obtained, but before performing # any updates or builds. Do any steps that need to be done only in the case of # being run by Coverity. This subroutine is only called if the COVERITY_RUN @@ -217,7 +233,17 @@ sub perform_coverity_checks() system("pkg-config", "--variable=prefix", "dbus-1"); } - download_install_cmake(); + unless (check_cmake_installed()) + { + info "CMake 2.4.3 does not appear to be installed. At least its not in \$PATH"; + info "So just for you guys, I'll go ahead and install it for you."; + + if (not download_install_cmake()) + { + error "\nWell, we were b[r[unable to install] CMake for some reason."; + error "Check your logs afterwards."; + } + } # Print blank line. info "";