Whamcloud - gitweb
LU-13178 build: Update ZFS version to 0.8.3
[fs/lustre-release.git] / contrib / lbuild / lbuild
index 10425c9..5e19901 100755 (executable)
@@ -414,6 +414,14 @@ compare_version () {
     return 1
 }
 
+# Return a numeric version code based on a version string.  The version
+# code is useful for comparison two version strings to see which is newer.
+version_code() {
+    # split arguments like "0.8.0" into "0", "8", "0"
+    eval set -- $(tr "[:punct:]" " " <<< $*)
+    echo -n "$((($1 << 16) | ($2 << 8) | $3))"
+}
+
 uniqify() {
 
     echo $(echo "$*" | xargs -n 1 | sort -u)
@@ -1010,11 +1018,12 @@ build_spl_zfs() {
     # The spl/zfs spec files expect RPM_BUILD_ROOT to point to the root of the
     # destination for the rpms
     export RPM_BUILD_ROOT=$TOPDIR
-    SPLZFSVER=${SPLZFSVER:-0.7.13}
+    SPLZFSVER=${SPLZFSVER:-0.8.3}
     SPLZFSTAG=${SPLZFSTAG:-}
     # "spl zfs" prior to 0.8.0
     # "zfs" for 0.8.0 and later
-    SPLZFSPKGS="spl zfs"
+    (( $(version_code $SPLZFSVER) < $(version_code 0.8.0) )) &&
+        SPLZFSPKGS="spl zfs" || SPLZFSPKGS="zfs"
 
     # The files expect a kver to be set to the kernel version .
     local kver=$(find_linux_release)