Skip to content

Commit

Permalink
docs/support-matrix: unbreak docs rendering
Browse files Browse the repository at this point in the history
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 version,
rather than expecting xen/Makefile to be usable in a different tree.

Fixes: 945e80a ("docs: Provide support-matrix-generate, to generate a support matrix in HTML")
Backport: 4.11+
Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Ian Jackson <[email protected]>
Release-acked-by: Paul Durrant <[email protected]>
  • Loading branch information
andyhhp committed Jun 8, 2020
1 parent 75131ad commit 11ba5cd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/support-matrix-generate
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#
# 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
# some slight assumption about how xen/Makefile's variables are
# written, 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.
Expand Down Expand Up @@ -102,12 +102,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"
Expand Down

0 comments on commit 11ba5cd

Please sign in to comment.