moinsetup

Changeset

73:d0d1b660c778
2013-02-26 Paul Boddie raw files shortlog changelog graph Changed the post-install scripts to support filenames containing spaces.
moinsetup.py (file)
     1.1 --- a/moinsetup.py	Sun Feb 24 19:45:26 2013 +0100
     1.2 +++ b/moinsetup.py	Tue Feb 26 01:08:13 2013 +0100
     1.3 @@ -95,20 +95,20 @@
     1.4  postsetup_setfacl = """\
     1.5  #!/bin/sh
     1.6  
     1.7 -find '%(common_dir)s/data' -type f | xargs setfacl -m u:%(web_user)s:rw
     1.8 -find '%(common_dir)s/data' -type d | xargs setfacl -m u:%(web_user)s:rwx
     1.9 -find '%(common_dir)s/data/plugin' -type f | xargs setfacl -m u:%(web_user)s:r
    1.10 -find '%(common_dir)s/data/plugin' -type d | xargs setfacl -m u:%(web_user)s:rx
    1.11 -find '%(common_dir)s/underlay' -type f | xargs setfacl -m u:%(web_user)s:rw
    1.12 -find '%(common_dir)s/underlay' -type d | xargs setfacl -m u:%(web_user)s:rwx
    1.13 +find '%(common_dir)s/data' -type f -print0 | xargs -0 setfacl -m u:%(web_user)s:rw
    1.14 +find '%(common_dir)s/data' -type d -print0 | xargs -0 setfacl -m u:%(web_user)s:rwx
    1.15 +find '%(common_dir)s/data/plugin' -type f -print0 | xargs -0 setfacl -m u:%(web_user)s:r
    1.16 +find '%(common_dir)s/data/plugin' -type d -print0 | xargs -0 setfacl -m u:%(web_user)s:rx
    1.17 +find '%(common_dir)s/underlay' -type f -print0 | xargs -0 setfacl -m u:%(web_user)s:rw
    1.18 +find '%(common_dir)s/underlay' -type d -print0 | xargs -0 setfacl -m u:%(web_user)s:rwx
    1.19  if [ -e "%(common_dir)s/wikiconfig.py" ]; then
    1.20      setfacl -m u:%(web_user)s:r '%(common_dir)s/wikiconfig.py'
    1.21  fi
    1.22  """
    1.23  
    1.24  postsetup_setfacl_extra = """
    1.25 -find '%(htdocs_dir)s' -type f | xargs setfacl -m u:%(web_user)s:r
    1.26 -find '%(htdocs_dir)s' -type d | xargs setfacl -m u:%(web_user)s:rx
    1.27 +find '%(htdocs_dir)s' -type f -print0 | xargs -0 setfacl -m u:%(web_user)s:r
    1.28 +find '%(htdocs_dir)s' -type d -print0 | xargs -0 setfacl -m u:%(web_user)s:rx
    1.29  """
    1.30  
    1.31  postsetup_setfacl_logs = """
    1.32 @@ -124,12 +124,12 @@
    1.33  
    1.34  chown -R %(this_user)s.%(web_group)s '%(common_dir)s/data'
    1.35  chown -R %(this_user)s.%(web_group)s '%(common_dir)s/underlay'
    1.36 -find '%(common_dir)s/data' -type f | xargs chmod g=rw
    1.37 -find '%(common_dir)s/data' -type d | xargs chmod g=rwx
    1.38 -find '%(common_dir)s/data/plugin' -type f | xargs chmod g=r
    1.39 -find '%(common_dir)s/data/plugin' -type d | xargs chmod g=rx
    1.40 -find '%(common_dir)s/underlay' -type f | xargs chmod g=rw
    1.41 -find '%(common_dir)s/underlay' -type d | xargs chmod g=rwx
    1.42 +find '%(common_dir)s/data' -type f -print0 | xargs -0 chmod g=rw
    1.43 +find '%(common_dir)s/data' -type d -print0 | xargs -0 chmod g=rwx
    1.44 +find '%(common_dir)s/data/plugin' -type f -print0 | xargs -0 chmod g=r
    1.45 +find '%(common_dir)s/data/plugin' -type d -print0 | xargs -0 chmod g=rx
    1.46 +find '%(common_dir)s/underlay' -type f -print0 | xargs -0 chmod g=rw
    1.47 +find '%(common_dir)s/underlay' -type d -print0 | xargs -0 chmod g=rwx
    1.48  if [ -e "%(common_dir)s/wikiconfig.py" ]; then
    1.49      chown %(this_user)s.%(web_group)s '%(common_dir)s/wikiconfig.py'
    1.50      chmod g=r '%(common_dir)s/wikiconfig.py'