From 9524307c0d07f9c704b3fe4e76634f4b73360b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 25 Aug 2019 00:00:00 +0000 Subject: [PATCH] build-doc: verify that there are no github readme links --- baremetal/lib/syscalls_asm.S | 2 +- build-doc | 18 ++++++++++++++++++ common.py | 1 + path_properties.py | 4 ++-- userland/arch/aarch64/freestanding/README.adoc | 2 +- userland/arch/aarch64/nostartfiles/README.adoc | 2 +- userland/arch/arm/freestanding/README.adoc | 2 +- userland/arch/x86_64/freestanding/README.adoc | 2 +- 8 files changed, 26 insertions(+), 7 deletions(-) diff --git a/baremetal/lib/syscalls_asm.S b/baremetal/lib/syscalls_asm.S index a1bcd9f..30cc367 100644 --- a/baremetal/lib/syscalls_asm.S +++ b/baremetal/lib/syscalls_asm.S @@ -15,7 +15,7 @@ _exit: LKMC_M5OPS_EXIT_ASM #else /* Use semihosting: - * https://github.com/cirosantilli/linux-kernel-module-cheat#semihosting */ + * https://cirosantilli.com/linux-kernel-module-cheat#semihosting */ #if defined(__arm__) mov r0, #0x18 ldr r1, =#0x20026 diff --git a/build-doc b/build-doc index f81950e..5eab018 100755 --- a/build-doc +++ b/build-doc @@ -56,6 +56,24 @@ from the README to example sources to GitHub rather than locally. self.log_error('broken link to local file: ' + link) exit_status = 1 + # Check that there are not links to the GitHub README. + # https://github.com/isaacs/github/issues/1610 + for grep_line in self.sh.check_output( + [ + 'git', + 'grep', + '--fixed-strings', + self.env['github_repo_url'] + '#', + LF + ], + cwd=self.env['root_dir'], + raise_on_failure=False + ).decode().splitlines(): + self.log_error('link to GitHub readme: {}'.format( + grep_line + )) + exit_status = 1 + # Check that non-README links to README IDs exit. header_ids = set() grep_line_location_re = re.compile('^(.*?:\d+):') diff --git a/common.py b/common.py index 3f20404..dcb5bcd 100644 --- a/common.py +++ b/common.py @@ -102,6 +102,7 @@ consts['sha'] = common.git_sha(consts['root_dir']) consts['release_dir'] = os.path.join(consts['out_dir'], 'release') consts['release_zip_file'] = os.path.join(consts['release_dir'], 'lkmc-{}.zip'.format(consts['sha'])) consts['github_repo_id'] = 'cirosantilli/linux-kernel-module-cheat' +consts['github_repo_url'] = 'https://github.com/' + consts['github_repo_id'] consts['homepage_url'] = 'https://cirosantilli.com/linux-kernel-module-cheat' consts['asm_ext'] = '.S' consts['c_ext'] = '.c' diff --git a/path_properties.py b/path_properties.py index 7f130be..fbbaf26 100644 --- a/path_properties.py +++ b/path_properties.py @@ -260,7 +260,7 @@ gnu_extension_properties = { 'cc_pedantic': False, 'cxx_std': 'gnu++17' } -# https://github.com/cirosantilli/linux-kernel-module-cheat#freestanding-programs +# https://cirosantilli.com/linux-kernel-module-cheat#freestanding-programs freestanding_properties = { 'baremetal': False, 'cc_flags': [ @@ -270,7 +270,7 @@ freestanding_properties = { ], 'extra_objs_lkmc_common': False, } -# https://github.com/cirosantilli/linux-kernel-module-cheat#nostartfiles-programs +# https://cirosantilli.com/linux-kernel-module-cheat#nostartfiles-programs nostartfiles_properties = { 'baremetal': False, 'cc_flags': [ diff --git a/userland/arch/aarch64/freestanding/README.adoc b/userland/arch/aarch64/freestanding/README.adoc index ff42a8a..e01d17d 100644 --- a/userland/arch/aarch64/freestanding/README.adoc +++ b/userland/arch/aarch64/freestanding/README.adoc @@ -1 +1 @@ -https://github.com/cirosantilli/linux-kernel-module-cheat#freestanding-programs +https://cirosantilli.com/linux-kernel-module-cheat#freestanding-programs diff --git a/userland/arch/aarch64/nostartfiles/README.adoc b/userland/arch/aarch64/nostartfiles/README.adoc index 2a2f030..488ce67 100644 --- a/userland/arch/aarch64/nostartfiles/README.adoc +++ b/userland/arch/aarch64/nostartfiles/README.adoc @@ -1 +1 @@ -https://github.com/cirosantilli/linux-kernel-module-cheat#nostartfiles-programs +https://cirosantilli.com/linux-kernel-module-cheat#nostartfiles-programs diff --git a/userland/arch/arm/freestanding/README.adoc b/userland/arch/arm/freestanding/README.adoc index ff42a8a..e01d17d 100644 --- a/userland/arch/arm/freestanding/README.adoc +++ b/userland/arch/arm/freestanding/README.adoc @@ -1 +1 @@ -https://github.com/cirosantilli/linux-kernel-module-cheat#freestanding-programs +https://cirosantilli.com/linux-kernel-module-cheat#freestanding-programs diff --git a/userland/arch/x86_64/freestanding/README.adoc b/userland/arch/x86_64/freestanding/README.adoc index ff42a8a..e01d17d 100644 --- a/userland/arch/x86_64/freestanding/README.adoc +++ b/userland/arch/x86_64/freestanding/README.adoc @@ -1 +1 @@ -https://github.com/cirosantilli/linux-kernel-module-cheat#freestanding-programs +https://cirosantilli.com/linux-kernel-module-cheat#freestanding-programs