Add version check to liburcu build
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 13 Nov 2015 19:50:54 +0000 (14:50 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Fri, 13 Nov 2015 19:50:54 +0000 (14:50 -0500)
scripts/liburcu/build.sh

index ef97773b7ba84b4895251126eecf497d46e172d8..eaf952530a15dade318160519a18af21205ca22c 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Version compare functions
+verlte() {
+    [  "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
+}
+
+verlt() {
+    [ "$1" = "$2" ] && return 1 || verlte $1 $2
+}
+
+vergte() {
+    [  "$1" = "`printf '%s\n%s' $1 $2 | sort -V | tail -n1`" ]
+}
+
+vergt() {
+    [ "$1" = "$2" ] && return 1 || vergte $1 $2
+}
+
 
 # Create build directory
 rm -rf $WORKSPACE/build
@@ -70,6 +87,9 @@ esac
 # Run bootstrap prior to configure
 ./bootstrap
 
+# Get source version from configure script
+eval `grep '^PACKAGE_VERSION=' ./configure`
+
 
 # Build type
 # oot : out-of-tree build
@@ -118,9 +138,10 @@ $MAKE install
 
 # Run tests
 $MAKE check
-#if [ "$version" >=" 0.9" ]; then
+# Only run regtest for 0.9 and up
+if vergte "$PACKAGE_VERSION" "0.9"; then
    $MAKE regtest
-#fi
+fi
 
 # Cleanup
 $MAKE clean
This page took 0.024985 seconds and 4 git commands to generate.