Module: Mesa
Branch: master
Commit: 47f52e83d1074b3833a4a4c98b87ac23c04a38f6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=47f52e83d1074b3833a4a4c98b87ac23c04a38f6

Author: Erik Faye-Lund <[email protected]>
Date:   Wed Oct 21 13:42:30 2020 +0200

docs: specify redirects relative to docs-root

It's a lot easier to reason about redirects if they're specified
relative to thje docs-root, so let's do that instead.

Reviewed-by: Eric Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>

---

 docs/_exts/redirects.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/_exts/redirects.py b/docs/_exts/redirects.py
index 4528189956e..04308b711bd 100644
--- a/docs/_exts/redirects.py
+++ b/docs/_exts/redirects.py
@@ -1,4 +1,5 @@
 import os
+import pathlib
 from urllib.parse import urlparse
 
 redirects = [
@@ -20,6 +21,7 @@ def create_redirects(app, docname):
         os.makedirs(os.path.dirname(path), exist_ok=True)
 
         if urlparse(dst).scheme == "":
+            dst = pathlib.posixpath.relpath(dst, start=os.path.dirname(src))
             if not os.path.isfile(os.path.join(os.path.dirname(path), dst)):
                 raise Exception('{0} does not exitst'.format(dst))
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to