summaryrefslogtreecommitdiff
path: root/web-export
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-10-22 10:31:51 +0200
committerBastien Nocera <hadess@hadess.net>2019-10-22 11:02:18 +0200
commit7390adadbe4821624a3beeafd8ff9420a455b148 (patch)
tree7f15cf2245bff4c12f97616e4098416613a4bf2a /web-export
parentf97dad781c5a7c99f65617a9509476836d4596cd (diff)
web-export: Move all generated files to the public directory
Diffstat (limited to 'web-export')
-rwxr-xr-xweb-export/update.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/web-export/update.py b/web-export/update.py
index bb1e437..d290e47 100755
--- a/web-export/update.py
+++ b/web-export/update.py
@@ -34,6 +34,9 @@ DEVELOPMENT = True
# But since docbook2html isn't installed there, we currently have to run it locally so this is now True (i.e. it uses the local files)
USELOCALFILES = True
+# Directory to put everything in, relative to the git root directory
+OUTPUTDIR = "public"
+
GITWEB = 'http://gitlab.freedesktop.org'
HASH = 'md5'
@@ -269,7 +272,13 @@ else:
lines = open('specs.idx').readlines()
+out = subprocess.check_output(["git rev-parse --show-toplevel"], shell=True)
+root_dir = out.decode('utf-8').rstrip()
+public_dir = os.path.join(root_dir, OUTPUTDIR)
+safe_mkdir(public_dir)
+
latests = []
+source_dirs = {}
for line in lines:
line = line.strip()
@@ -295,3 +304,13 @@ for line in lines:
if (spec.spec_dir, spec.basename_no_ext) not in latests:
latests.append((spec.spec_dir, spec.basename_no_ext))
spec.latestize()
+
+ target_dir = os.path.join(public_dir, spec.spec_dir)
+ src_dir = spec.spec_dir
+ if path in SELF_BUILT:
+ src_dir = os.path.join("../", os.path.dirname(vcs.file), "html")
+ if src_dir not in source_dirs:
+ source_dirs[src_dir] = target_dir
+
+for dirs in source_dirs.items():
+ shutil.copytree(dirs[0], dirs[1], symlinks=True)