[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 for-4.14] docs/support-matrix: unbreak docs rendering



The cronjob which renders https://xenbits.xen.org/docs/ has been broken for a
while.  commitish_version() pulls an old version of xen/Makefile out of
history, and uses the xenversion rule.

Currently, this fails with:

  tmp.support-matrix.xen.make:130: scripts/Kbuild.include: No such file or 
directory

which is because the Makefile legitimately references Kbuild.include with a
relative rather than absolute path.

Rework support-matrix-generate to use sed to extract the major/minor, rather
than expecting xen/Makefile to be usable in a different tree.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
CC: Paul Durrant <paul@xxxxxxx>

v2:
 * Use sed rather than fixing up the makefile environment

This needs backporting to all trees with the support matrix logic, to unbreak
docs rendering
---
 docs/support-matrix-generate | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/docs/support-matrix-generate b/docs/support-matrix-generate
index a3d93321f1..b759d0440c 100755
--- a/docs/support-matrix-generate
+++ b/docs/support-matrix-generate
@@ -26,12 +26,9 @@
 # SUPPORT.md into json.
 #
 # Then we try to find the next previous revision.  This is done by
-# extracting the current version number from xen/Makefile.  (We make
-# some slight assumption about how xen/Makefile's xenversion target
-# works, because we want to be able to do this without checking out
-# the whole tree for the version in question.)  Then we use git log on
-# xen/Makefile to try to find a commit where the version changed.
-# This gives us the previous version number, NN.
+# extracting the current version number from xen/Makefile.  Then we
+# use git log on xen/Makefile to try to find a commit where the
+# version changed.  This gives us the previous version number, NN.
 #
 # That is substituted into the `refs/remotes/origin/stable-NN'
 # argument to get the tip of the relevant branch.  That in turns
@@ -102,12 +99,16 @@ commitish_version () {
     esac
 
     git cat-file blob "$commitish:$versionfile" >"$tmp_versionfile"
-    version=$(make --no-print-directory -C docs \
-                   -f "${tmp_versionfile#docs/}" xenversion)
-    case "$version" in
-        *.*.*) version="${version%.*}" ;;
-    esac
-    printf "%s\n" "${version%%-*}"
+
+    local maj=$(sed -n 's/.*XEN_VERSION.*= \([0-9]\+\)/\1/p' < 
"$tmp_versionfile")
+    local min=$(sed -n 's/.*XEN_SUBVERSION.*= \([0-9]\+\)/\1/p' < 
"$tmp_versionfile")
+
+    if [[ -z $maj || -z $min ]];
+    then
+        fail "Unable to identify Xen version for ${commitish}";
+    fi
+
+    printf "%d.%d\n" "${maj}" "${min}"
 }
 
 exec 4>"$tmp_revisions"
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.