From 592933cbe0737e2c35b6e9839bc344b53fc06f7d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 13 Feb 2008 18:55:32 +0000 Subject: Add a bunch of TODOs. Adjust cosmetic line-ends at perl routine. --- localikiwikicreatesite | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'localikiwikicreatesite') diff --git a/localikiwikicreatesite b/localikiwikicreatesite index 42cfb27..a9d3623 100755 --- a/localikiwikicreatesite +++ b/localikiwikicreatesite @@ -3,12 +3,17 @@ # /usr/local/bin/localikiwikicreatesite # Copyright 2008 Jonas Smedegaard # -# $Id: localikiwikicreatesite,v 1.16 2008-02-13 17:16:18 jonas Exp $ +# $Id: localikiwikicreatesite,v 1.17 2008-02-13 18:55:32 jonas Exp $ # # Initialize ikiwiki site # # Origin: http://ikiwiki.info/setup/ # +# TODO: Explicitly replace ~ with $HOME for shell use, and $ENV{'HOME'} for Perl +# TODO: Quote variables everywhere +# TODO: Implement --verbose option +# TODO: Check for name collision and ask (except when --force is enabled) +# set -e @@ -138,6 +143,15 @@ git_init_work "$project" "$CFGDIR" "/content" git_init_work "${project}_content" "$SRCDIR" "/.ikiwiki" ## Adjust backend to actual paths, and enable Git post-update wrapper +# TODO: Rewrite as semi-generic functions: +#perl_param_enable_set "$CFGDIR/ikiwiki.setup" "srcdir" "$SRCDIR" +#perl_param_enable_set "$CFGDIR/ikiwiki.setup" "destdir" "$DESTDIR" +#perl_param_enable_set "$CFGDIR/ikiwiki.setup" "url" "$host" +#perl_param_disable "$CFGDIR/ikiwiki.setup" "cgiurl" +#perl_param_match_enable "$CFGDIR/ikiwiki.setup" "rcs" "git" +#perl_section_match_enable_param_set "$CFGDIR/ikiwiki.setup" "git post-update wrapper" "wrapper" "$DESTSRCDIR/${project}_content.git/hooks/post-update-$project" +#perl_section_match_enable_param_match_enable "$CFGDIR/ikiwiki.setup" "git post-update wrapper" "wrappermode" "06755" +#shell_line_match_enable_appendlinebefore "$DESTSRCDIR/${project}_content.git/hooks/post-update" "^exec" "hooks/post-update-$project\n" perl -pi -e ' s,^(\s*)#?(srcdir\s*=>\s*")[^"]*("\,\s*),$1$2'$SRCDIR'$3,; s,^(\s*)#?(destdir\s*=>\s*")[^"]*("\,\s*),$1$2'$DESTDIR'$3,; @@ -148,7 +162,9 @@ perl -pi -e ' perl -0 -pi -e ' s,#{([\s#]*The git post-update wrapper[^}]*\s*)#(\s*wrapper =>\s*")[^"]*("\,\s*[^}]*)#(\s*wrappermode =>[^}]*)#},{$1$2'$DESTSRCDIR/${project}_content.git/hooks/post-update-$project'$3$4},; ' $CFGDIR/ikiwiki.setup -perl -0 -pi -e 's,\n(exec\s[^\n]*),\nhooks/post-update-'"$project"'\n\n$1,' $DESTSRCDIR/${project}_content.git/hooks/post-update +perl -0 -pi -e ' + s,\n(exec\s[^\n]*),\nhooks/post-update-'"$project"'\n\n$1,; + ' $DESTSRCDIR/${project}_content.git/hooks/post-update (cd $CFGDIR git add ikiwiki.setup git commit -m "Adjust ikiwiki.setup to use actual paths, and add+enable Git post-update hooks" -- cgit v1.2.3