From f813b97a0e3a45d3d42664119bbb4042bb3bcf1d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 11 Feb 2008 21:55:11 +0000 Subject: More robust Git enabling. Separate config adjustments from Makefile creation. Chdir only (every time) when running git. --- localikiwikicreatesite | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'localikiwikicreatesite') 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 +) -- cgit v1.2.3