[yocto-autobuilder-helper,1/4] scripts: run-docs-build: simplify patching logic

Message ID 20220315163115.2186540-1-foss+yocto@0leil.net
State New
Headers show
Series [yocto-autobuilder-helper,1/4] scripts: run-docs-build: simplify patching logic | expand

Commit Message

Quentin Schulz March 15, 2022, 4:31 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

There's no need to keep a list of tags requiring to be patched since the
tag is part of the path where patches are stored.

Therefore, let's only check if there's a patch directory for a given tag
and if so, apply all patches in there.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 scripts/run-docs-build | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Michael Opdenacker March 16, 2022, 9:51 a.m. UTC | #1
Hi Quentin,

On 3/15/22 17:31, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> There's no need to keep a list of tags requiring to be patched since the
> tag is part of the path where patches are stored.
>
> Therefore, let's only check if there's a patch directory for a given tag
> and if so, apply all patches in there.


Too late to give you a "Reviewed-by", but thanks for the corrections and
simplifications!
Cheers
Michael.

Patch

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index cca4e4d..73cba3f 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -111,11 +111,7 @@  for tag in $(git tag --list 'yocto-*'); do
         echo Processing $tag
         cd $ypdocs
         git checkout $tag
-        # Update versions tagged before the current_version in
-        # conf.py was changed resulting in sphinx believing these are
-        # development branches which breaks all sorts of assumptions. Moving a
-        # tag isn't best practice so we just patch the releases here instead.
-        if [ "$tag" = "yocto-3.3" ] || [ "$tag" = "yocto-3.3.5" ] || [ "$tag" = "yocto-3.4" ] || [ "$tag" = "yocto-3.1.14" ] || [ "$tag" = "yocto-3.4.2" ] ; then
+	if [ -e "${scriptdir}/docs-build-patches/${tag}/" ]; then
             echo Adding patch for $tag
             git am "${scriptdir}/docs-build-patches/${tag}/"000*
         fi