1.1 --- a/moinsetup.py Thu Jan 10 22:07:27 2013 +0100
1.2 +++ b/moinsetup.py Thu Jan 10 23:59:19 2013 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 A setup and configuration script for MoinMoin.
1.6
1.7 -Copyright (C) 2010, 2011, 2012 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2010, 2011, 2012, 2013 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -25,9 +25,10 @@
1.13 from glob import glob
1.14 from zipfile import ZipFile
1.15 import os
1.16 -import sys
1.17 +import py_compile
1.18 +import re
1.19 import shutil
1.20 -import re
1.21 +import sys
1.22 import tempfile
1.23
1.24 __version__ = "0.4"
1.25 @@ -92,6 +93,8 @@
1.26
1.27 find '%(common_dir)s/data' -type f | xargs setfacl -m u:%(web_user)s:rw
1.28 find '%(common_dir)s/data' -type d | xargs setfacl -m u:%(web_user)s:rwx
1.29 +find '%(common_dir)s/data/plugin' -type f | xargs setfacl -m u:%(web_user)s:r
1.30 +find '%(common_dir)s/data/plugin' -type d | xargs setfacl -m u:%(web_user)s:rx
1.31 find '%(common_dir)s/underlay' -type f | xargs setfacl -m u:%(web_user)s:rw
1.32 find '%(common_dir)s/underlay' -type d | xargs setfacl -m u:%(web_user)s:rwx
1.33 if [ -e "%(common_dir)s/wikiconfig.py" ]; then
1.34 @@ -115,11 +118,15 @@
1.35
1.36 chown -R %(this_user)s.%(web_group)s '%(common_dir)s/data'
1.37 chown -R %(this_user)s.%(web_group)s '%(common_dir)s/underlay'
1.38 -chmod -R g+w '%(common_dir)s/data'
1.39 -chmod -R g+w '%(common_dir)s/underlay'
1.40 +find '%(common_dir)s/data' -type f | xargs chmod g=rw
1.41 +find '%(common_dir)s/data' -type d | xargs chmod g=rwx
1.42 +find '%(common_dir)s/data/plugin' -type f | chmod g=r
1.43 +find '%(common_dir)s/data/plugin' -type d | chmod g=rx
1.44 +find '%(common_dir)s/underlay' -type f | xargs chmod g=rw
1.45 +find '%(common_dir)s/underlay' -type d | xargs chmod g=rwx
1.46 if [ -e "%(common_dir)s/wikiconfig.py" ]; then
1.47 chown %(this_user)s.%(web_group)s '%(common_dir)s/wikiconfig.py'
1.48 - chmod g+r '%(common_dir)s/wikiconfig.py'
1.49 + chmod g=r '%(common_dir)s/wikiconfig.py'
1.50 fi
1.51 """
1.52
1.53 @@ -1361,6 +1368,11 @@
1.54 for module in glob(join(plugins_dir, "*%spy" % extsep)):
1.55 shutil.copy(module, plugin_target_dir)
1.56
1.57 + # Compile the plugin.
1.58 +
1.59 + plugin = join(plugins_dir, split(module)[-1])
1.60 + py_compile.compile(plugin)
1.61 +
1.62 def install_actions(self, actions_dir):
1.63
1.64 "Install Wiki actions provided in the given 'actions_dir'."