projects
/
platform
/
upstream
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a85c318
)
docs: verify that targets for relative redirects exist
author
Erik Faye-Lund
<erik.faye-lund@collabora.com>
Wed, 21 Oct 2020 11:38:23 +0000
(13:38 +0200)
committer
Marge Bot
<eric+marge@anholt.net>
Wed, 21 Oct 2020 18:11:39 +0000
(18:11 +0000)
This makes it a bit easier to update the redirects.
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>
docs/_exts/redirects.py
patch
|
blob
|
history
diff --git
a/docs/_exts/redirects.py
b/docs/_exts/redirects.py
index
0320f2c
..
4528189
100644
(file)
--- a/
docs/_exts/redirects.py
+++ b/
docs/_exts/redirects.py
@@
-1,4
+1,5
@@
import os
+from urllib.parse import urlparse
redirects = [
('llvmpipe', 'gallium/drivers/llvmpipe.html'),
@@
-15,7
+16,13
@@
def create_redirects(app, docname):
return
for src, dst in redirects:
path = os.path.join(app.outdir, '{0}.html'.format(src))
+
os.makedirs(os.path.dirname(path), exist_ok=True)
+
+ if urlparse(dst).scheme == "":
+ if not os.path.isfile(os.path.join(os.path.dirname(path), dst)):
+ raise Exception('{0} does not exitst'.format(dst))
+
with open(path, 'w') as f:
f.write(create_redirect(dst))