Skip to content

Commit b751072

Browse files
committed
[DOC] Link Check
1 parent aae21db commit b751072

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

doc/about/api/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ this should not be a problem.
3838
We promise to support the above compilers in the latest release of Sharg, or until all the following
3939
operating systems provide a newer supported compiler:
4040

41-
| Operating System | Supported Releases¹ |
41+
| Operating System | Supported Releases |
4242
|------------------------------|----------------------------------------|
43-
| RedHat Enterprise Linux | the latest release ² |
44-
| CentOS Linux | the latest release ² |
43+
| RedHat Enterprise Linux | the latest release ¹ |
44+
| CentOS Linux | the latest release ¹ |
4545
| SUSE Linux Enterprise Server | the latest release |
4646
| Debian GNU/Linux | "stable" and "old-stable" |
4747
| Ubuntu Linux | the two latest LTS releases |
@@ -58,9 +58,7 @@ third party services.
5858
**We promise to provide good forward-compatibility with the C++ standard.** And we will strive to fix any warnings that
5959
are added by newer versions of a supported compiler.
6060

61-
<small[This site](https://linuxlifecycle.com) provides a good overview of what the current release and its
62-
lifecycle is.</small><br>
63-
<small>² We consider CentOS 7 / RedHat Enterprise Linux (RHEL) 7 as being community-supported. That means issues and
61+
<small>¹ We consider CentOS 7 / RedHat Enterprise Linux (RHEL) 7 as being community-supported. That means issues and
6462
patches are welcome, but we do not actively test for those operating systems. See this related
6563
[issue](https://github.com/seqan/seqan3/issues/2244).</small>
6664

test/external_project/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ExternalProject_Add (
4949
# This test assumes that `sharg-config.cmake` can be found by cmake in some global paths like /usr/share/cmake/.
5050
#
5151
# We simulate this by using our `make package` release, e.g. the one we release under
52-
# https://github.com/seqan/sharg/releases, and unzipping it to some folder and making
52+
# https://github.com/seqan/sharg-parser/releases, and unzipping it to some folder and making
5353
# that path globally accessible by CMAKE_SYSTEM_PREFIX_PATH.
5454
# (ExternalProject_Add simulates a fresh and separate invocation of cmake ../)
5555
ExternalProject_Add (
@@ -64,7 +64,7 @@ add_dependencies (sharg_installed sharg_test_prerequisite)
6464

6565
# 4) This tests test/external_project/sharg_fetch_content_zip/CMakeLists.txt
6666
# It uses fetch_content (a CMake 3.14 feature) to download our zip-release (e.g. zip, tar.xz) from
67-
# https://github.com/seqan/sharg/releases. fetch_content will automatically download, verify, extract it.
67+
# https://github.com/seqan/sharg-parser/releases. fetch_content will automatically download, verify, extract it.
6868
# The user only needs to define CMAKE_PREFIX_PATH to be able to find our `sharg-config.cmake`.
6969
# Note that FetchContent is a CMake >= 3.14 feature.
7070
# This is expected to work with CMake >= 3.14.

test/scripts/link_check.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,30 @@
1212
# The general workflow is to first run the script and then check the non-working links by searching the occurrence
1313
# within the codebase and verifying that they are indeed broken.
1414

15+
COUNT=0
1516
do_check ()
1617
{
17-
RESPONSE=$(curl --http2 -Is -A 'Mozilla/5.0' $1) # HTTP2 is the default.
18-
if ! [[ "$RESPONSE" =~ ^HTTP.* ]]; then # If this does not work,
19-
RESPONSE=$(curl --http1.1 -Is -A 'Mozilla/5.0' $1) # fall back to HTTP1.1.
18+
(( COUNT++ ))
19+
RESPONSE=$(curl --http2 -Is -A 'Mozilla/5.0' "$1") # HTTP2 is the default.
20+
if ! [[ "${RESPONSE}" =~ ^HTTP.* ]]; then # If this does not work,
21+
RESPONSE=$(curl --http1.1 -Is -A 'Mozilla/5.0' "$1") # fall back to HTTP1.1.
2022
fi
2123

22-
HEADER=($(echo $RESPONSE | head -1)); # May look like: HTTP/2 200
24+
HEADER=($(echo "${RESPONSE}" | head -1)); # May look like: HTTP/2 200
2325
STATUS=${HEADER[1]}
26+
echo -n "[${COUNT}] "
2427
case "$STATUS" in
25-
200) echo "Link OK :" $1;;
26-
301) echo "Link PERM MOVED :" $1;;
27-
302) echo "Link TEMP MOVED :" $1;;
28-
404) echo "Link BROKE :" $1;;
29-
429) sleep 5; do_check $1;;
30-
*) echo "Link STATUS" $STATUS ":" $1;;
28+
200) echo "Link OK : $1";;
29+
301) echo "Link PERM MOVED : $1";;
30+
302) echo "Link TEMP MOVED : $1";;
31+
404) echo "Link BROKE : $1";;
32+
429) sleep 5; do_check "$1";;
33+
*) echo "Link STATUS ${STATUS} : $1";;
3134
esac
3235
}
3336

34-
if [[ $# -ne 1 ]]; then
35-
echo "Usage: link_check.sh <Sharg root directory>"
37+
if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
38+
echo "Usage: link_check.sh <Sharg root directory> <Skip first n=0 entries>"
3639
exit 1
3740
fi
3841

@@ -47,7 +50,10 @@ if [[ ! -f $1/include/sharg/version.hpp ]]; then
4750
exit 1
4851
fi
4952

50-
for URL in $(grep -ohr --exclude-dir={.git,submodules,build} "https*://[a-zA-Z0-9./#+?=_%:-]*[a-zA-Z0-9/#+?=_%:-]" $1 | sort | uniq)
53+
SKIP="${2:-0}"
54+
COUNT=$((COUNT + SKIP))
55+
56+
for URL in $(grep -ohr --exclude-dir={.git,.vscode,build} "https*://[a-zA-Z0-9./#+?=_%:-]*[a-zA-Z0-9/#+?=_%:-]" "$1" | sort | uniq | tail -n +"${SKIP}")
5157
do
52-
do_check $URL
58+
do_check "${URL}"
5359
done

0 commit comments

Comments
 (0)