[web] don't rename resources in gen-static-datadir
We should use the result from WebConfiguration.locate_resource to know
which file to copy, not what name to copy it to. The destination file
should be the name of the resource, as the client will request it.
This matters in the case of cubicweb.css which locate_resource might
rewrite to cubicweb.old.css.
Closes #3206129
--- a/web/webctl.py Wed Oct 23 14:18:58 2013 +0200
+++ b/web/webctl.py Thu Oct 10 10:02:29 2013 +0200
@@ -87,10 +87,10 @@
resources.update(osp.join(rel_dirpath, f) for f in filenames)
# locate resources and copy them to destination
for resource in resources:
- dirname = osp.dirname(resource)
- dest_resource = osp.join(dest, dirname)
- if not osp.isdir(dest_resource):
- os.makedirs(dest_resource)
+ dest_resource = osp.join(dest, resource)
+ dirname = osp.dirname(dest_resource)
+ if not osp.isdir(dirname):
+ os.makedirs(dirname)
resource_dir, resource_path = config.locate_resource(resource)
copy(osp.join(resource_dir, resource_path), dest_resource)
# handle md5 version subdirectory