-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·34 lines (26 loc) · 905 Bytes
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (c) 2023 Jani Nikula <[email protected]>
set -eu
# We could clone the repo, but save some bandwidth by retrieving the latest tag
# via git ls-remote, and its date via git web interface.
GIT_URL="git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
WEB_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag"
get_tag()
{
git -c "versionsort.suffix=-" ls-remote --exit-code --refs --sort="version:refname" --tags "${GIT_URL}" "*.*" |\
tail --lines=1 |\
cut --delimiter="/" --fields=3
}
get_date()
{
curl --silent "${WEB_URL}/?h=${1}" |\
grep "tag date" |\
sed "s|<tr><td>tag date</td><td>\(.*\)</td></tr>|\1|"
}
TAG=$(get_tag)
DATE=$(get_date "${TAG}")
echo $TAG
echo $DATE
./kernel-tea-leaves --tag="${TAG}" --date="${DATE}" > index.rst
rst2html --strict --no-raw index.rst > index.html