jjb: lttng-modules: Update discard strategy of the gerrit job
[lttng-ci.git] / scripts / lttng-modules / param-build.sh
index e016e135173081916b6c728f8daa22e7448970a7..e580dd41318866e0de4ab3049f580e7c6bb203de 100644 (file)
@@ -32,6 +32,7 @@ verlte() {
 }
 
 verlt() {
+    # shellcheck disable=SC2015
     [ "$1" = "$2" ] && return 1 || verlte "$1" "$2"
 }
 
@@ -40,13 +41,22 @@ vergte() {
 }
 
 vergt() {
+    # shellcheck disable=SC2015
     [ "$1" = "$2" ] && return 1 || vergte "$1" "$2"
 }
 
 
 git_clone_modules_sources() {
     mkdir -p "$MODULES_GIT_DIR"
-    git clone --depth=1 -b "${mversion}" "${mgitrepo}" "$MODULES_GIT_DIR"
+
+    # If the version starts with "refs/", checkout the specific git ref, otherwise treat it
+    # as a branch name.
+    if [ "${mversion:0:5}" = "refs/" ]; then
+        git clone --no-tags --depth=1 "${mgitrepo}" "$MODULES_GIT_DIR"
+        (cd "$MODULES_GIT_DIR" && git fetch origin "${mversion}" && git checkout FETCH_HEAD)
+    else
+        git clone --no-tags --depth=1 -b "${mversion}" "${mgitrepo}" "$MODULES_GIT_DIR"
+    fi
 }
 
 # Checkout a shallow kernel tree of the specified tag
@@ -314,7 +324,9 @@ extract_distro_headers() {
 
     # On powerpc 32bits this object is required to link modules
     if [ "${karch}" = "powerpc" ]; then
-        if [ "x$(scripts/config -s CONFIG_PPC64)" = "xn" ]; then
+        if [ "x$(scripts/config -s CONFIG_PPC64)" = "xy" ] && vergte "${kversion}" "5.4"; then
+            :
+        else
             cp -a --parents arch/powerpc/lib/crtsavres.[So] "${LINUX_HDROBJ_DIR}/"
         fi
     fi
@@ -374,7 +386,9 @@ extract_distro_headers() {
 
     # On powerpc 32bits this object is required to link modules
     if [ "${karch}" = "powerpc" ]; then
-        if [ "x$(scripts/config -s CONFIG_PPC64)" = "xn" ]; then
+        if [ "x$(scripts/config -s CONFIG_PPC64)" = "xy" ] && vergte "${kversion}" "5.4"; then
+            :
+        else
             make arch/powerpc/lib/crtsavres.o CC="$CC"
         fi
     fi
This page took 0.022889 seconds and 4 git commands to generate.