summaryrefslogtreecommitdiff
path: root/localikiwikicreatesite
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-02-11 03:09:27 +0000
committerJonas Smedegaard <dr@jones.dk>2008-02-11 03:09:27 +0000
commitd7361fd38dffb32f890331629aef20fca2f5bc07 (patch)
tree1524118824fe307e0da4c56399ba0d81c8ba5880 /localikiwikicreatesite
parenta06c8f63b13cc2041bee25f6375f3f3a07b16c01 (diff)
Enable git post-update wrapper. Tighten perl regexes.
Diffstat (limited to 'localikiwikicreatesite')
-rwxr-xr-xlocalikiwikicreatesite11
1 files changed, 7 insertions, 4 deletions
diff --git a/localikiwikicreatesite b/localikiwikicreatesite
index abcb063..e910f46 100755
--- a/localikiwikicreatesite
+++ b/localikiwikicreatesite
@@ -60,12 +60,15 @@ git push --all
## Adjust backend and add Makefile for further customization
perl -pi -e '
- s,^(\s*)#?(srcdir\s*=>\s*\")(.*)(\"\,\s*),$1$2'$SRCDIR'$4,;
- s,^(\s*)#?(destdir\s*=>\s*\")(.*)(\"\,\s*),$1$2'$DESTDIR'$4,;
- s,^(\s*)#?(url\s*=>\s*\")(.*)(\"\,\s*),$1$2http://'$host'$4,;
- s,^(\s*)#?(cgiurl\s*=>\s*\")(.*)(\"\,\s*),$1#$2$3$4,;
+ s,^(\s*)#?(srcdir\s*=>\s*\")[^\"]*(\"\,\s*),$1$2'$SRCDIR'$3,;
+ s,^(\s*)#?(destdir\s*=>\s*\")[^\"]*(\"\,\s*),$1$2'$DESTDIR'$3,;
+ s,^(\s*)#?(url\s*=>\s*\")[^\"]*(\"\,\s*),$1$2http://'$host'$3,;
+ s,^(\s*)#?(cgiurl\s*=>\s*\")([^\"]*)(\"\,\s*),$1#$2$3$4,;
s,^(\s*)#?(rcs\s*=>\s*\")(git)(\"\,\s*),$1$2$3$4,;
' $CFGDIR/ikiwiki.setup
+perl -0 -pi -e '
+ s,#{([\s#]*The git post-update wrapper[^}]*\s*)#(\s*wrapper =>\s*\")[^\"]*(/hooks/post-update\"\,\s*[^}]*)#(\s*wrappermode =>[^}]*)#},{$1$2'$DESTSRCDIR/content.git'$3$4},;
+ ' $CFGDIR/ikiwiki.setup
(
cd $CFGDIR
git add ikiwiki.setup