summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-02-11 21:55:11 +0000
committerJonas Smedegaard <dr@jones.dk>2008-02-11 21:55:11 +0000
commitf813b97a0e3a45d3d42664119bbb4042bb3bcf1d (patch)
tree8e2e4300f49f2be22106ed1f6c13af2bfc0e36a2
parentc04e9121e8136fc68743b0fa15549c7557766167 (diff)
More robust Git enabling. Separate config adjustments from Makefile creation. Chdir only (every time) when running git.
-rwxr-xr-xlocalikiwikicreatesite18
1 files changed, 13 insertions, 5 deletions
diff --git a/localikiwikicreatesite b/localikiwikicreatesite
index 2907174..b15d1f3 100755
--- a/localikiwikicreatesite
+++ b/localikiwikicreatesite
@@ -58,7 +58,7 @@ git config branch.master.merge refs/heads/master
git push --all
)
-## Adjust backend and add Makefile for further customization
+## Adjust backend to actual paths, and enable Git post-update wrapper
perl -pi -e '
s,^(\s*)#?(srcdir\s*=>\s*")[^"]*("\,\s*),$1$2'$SRCDIR'$3,;
s,^(\s*)#?(destdir\s*=>\s*")[^"]*("\,\s*),$1$2'$DESTDIR'$3,;
@@ -67,11 +67,15 @@ perl -pi -e '
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},;
+ s,#{([\s#]*The git post-update wrapper[^}]*\s*)#(\s*wrapper =>\s*")[^"]*("\,\s*[^}]*)#(\s*wrappermode =>[^}]*)#},{$1$2'$DESTSRCDIR/content.git/hooks/post-update-backend'$3$4},;
' $CFGDIR/ikiwiki.setup
(
cd $CFGDIR
git add ikiwiki.setup
+git commit -m "Adjust ikiwiki.setup to use actual paths and enable Git post-update wrapper"
+)
+
+## Add Makefile for further customization
cat <<'EOF' >$CFGDIR/Makefile
#underlays = basewiki smiley templates
underlays = templates
@@ -87,11 +91,15 @@ $(underlays):
cd $@ && git remote add -f -t $(master:LOCALE=$(locale)) -m $(master:LOCALE=$(locale)) origin http://source.jones.dk/ikiwiki_$@.git
cd $@ && git merge origin
EOF
-
-echo /Makefile > .gitignore
+echo /Makefile >> $CFGDIR/.gitignore
+(
+cd $CFGDIR
git add Makefile
git commit -m "Setup local paths"
-git push
)
ikiwiki --verbose $SRCDIR $DESTDIR --url=http://"$host" --setup $CFGDIR/ikiwiki.setup
+(
+cd $CFGDIR
+git push
+)