[PATCH v2 2/2] btrfs-progs Documentation: placeholder for contents.rst file

Anand Jain
2024-01-10T17:25:43Z

Sphinx error:
master file btrfs-progs/Documentation/contents.rst not found
make[1]: *** [Makefile:37: man] Error 2
make: *** [Makefile:502: build-Documentation] Error 2

This build error is seen on version 1.7.6-3 of the sphinx-build.

For now, to circumvent the build error, create a placeholder file
named contents.rst using the Makefile also add its cleanup.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
.gitignore | 1 +
Documentation/Makefile.in | 8 ++++++++
Makefile | 7 +++++++
3 files changed, 16 insertions(+)

diff --git a/.gitignore b/.gitignore
index 26f1940d5546..bb719b41d200 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,5 +79,6 @@

/Documentation/Makefile
/Documentation/_build
+/Documentation/contents.rst

*.patch
diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in
index ffc253863ba8..2c036eef00fa 100644
--- a/Documentation/Makefile.in
+++ b/Documentation/Makefile.in
@@ -28,6 +28,12 @@ man5dir = $(mandir)/man5
man8dir = $(mandir)/man8

.PHONY: all man help
+.PHONY: contents.rst
+
+contents.rst:
+ @if [ "$$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
+ touch contents.rst; \
+ fi

# Build manual pages by default

@@ -53,6 +59,8 @@ uninstall:
clean:
$(QUIET_RM)$(RM) -rf $(BUILDDIR)/*
$(QUIET_RM)$(RM) -df -- $(BUILDDIR)
+ $(QUIET_RM)$(RM) -f contents.rst
+

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
diff --git a/Makefile b/Makefile
index 374f59b99150..a031b0726a9c 100644
--- a/Makefile
+++ b/Makefile
@@ -417,6 +417,12 @@ endif
.PHONY: $(CLEANDIRS)
.PHONY: all install clean
.PHONY: FORCE
+.PHONY: contents.rst
+
+contents.rst:
+ @if [ "$$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
+ touch Documentation/contents.rst; \
+ fi

# Create all the static targets
static_objects = $(patsubst %.o, %.static.o, $(objects))
@@ -910,6 +916,7 @@ endif
clean-doc:
@echo "Cleaning Documentation"
$(Q)$(MAKE) $(MAKEOPTS) -C Documentation clean
+ $(Q)$(RM) -f -- Documentation/contents.rst

clean-gen:
@echo "Cleaning Generated Files"
--
2.31.1