From 01a9a12bbfbc21b45c59e4bbc52fbf488776d386 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Sep 2009 13:46:32 -0400 Subject: auto.setup, auto-blog.setup: Fix sanitization of entered wikiname. Closes: #547378 --- IkiWiki/Setup/Automator.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 742d67666..d1594d7ea 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -24,15 +24,20 @@ sub prettydir ($) { return $dir; } -sub import (@) { - my $this=shift; - IkiWiki::Setup::merge({@_}); +sub sanitize_wikiname ($) { + my $wikiname=shift; # Sanitize this to avoid problimatic directory names. - $config{wikiname}=~s/[^-A-Za-z0-9_]//g; - if (! length $config{wikiname}) { + $wikiname=~s/[^-A-Za-z0-9_]//g; + if (! length $wikiname) { error gettext("you must enter a wikiname (that contains alphanumerics)"); } + return $wikiname; +} + +sub import (@) { + my $this=shift; + IkiWiki::Setup::merge({@_}); # Avoid overwriting any existing files. foreach my $key (qw{srcdir destdir repository dumpsetup}) { -- cgit v1.2.3 From 3fd8a7f91ccf0f9628a345d7ae08e8bba508410c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Dec 2009 17:22:42 -0500 Subject: cvs: Add missing bit to Automator. --- IkiWiki/Setup/Automator.pm | 3 +++ debian/changelog | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index d1594d7ea..7af93e73c 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -72,6 +72,9 @@ sub import (@) { elsif ($config{rcs} eq 'mercurial') { # TODO } + elsif ($config{rcs} eq 'cvs') { + $config{cvs_wrapper}=$config{repository}."/CVSROOT/post-commit"; + } else { error sprintf(gettext("unsupported revision control system %s"), $config{rcs}); diff --git a/debian/changelog b/debian/changelog index 1408e4dce..c693be513 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20091203) UNRELEASED; urgency=low + + * cvs: Add missing bit to Automator. + + -- Joey Hess Wed, 02 Dec 2009 17:22:21 -0500 + ikiwiki (3.20091202) unstable; urgency=low * meta: Generate meta description tags even when the html scrubber is -- cgit v1.2.3 From 49d8c5b821743355fa60b30e1b2b456c44aaa221 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Feb 2010 15:18:53 -0500 Subject: setup automator: Configure Term::Readline to use bold for prompt, rather than default underline. Closes: #517656 --- IkiWiki/Setup/Automator.pm | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 7af93e73c..9fee4dcb7 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -15,6 +15,7 @@ sub ask ($$) { my ($question, $default)=@_; my $r=Term::ReadLine->new("ikiwiki"); + $r->ornaments("md,me"); $r->readline(encode_utf8($question)." ", $default); } diff --git a/debian/changelog b/debian/changelog index 5d27b7af0..8e01950a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * template: Preprocess parameters before htmlizing. * img: Fix a bug that could taint @links with undef values. + * setup automator: Configure Term::Readline to use bold for prompt, rather + than default underline. Closes: #517656 -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From a12c386c86d000971125d70bf22213fd9595ed45 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Feb 2010 16:26:13 -0500 Subject: Add force_overwrite setting to make setup automator overwrite existing files/directories. This can be useful if you're driving the setup automator from another program. --- IkiWiki/Setup/Automator.pm | 22 ++++++++++++---------- debian/changelog | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9fee4dcb7..79a610e20 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -40,17 +40,19 @@ sub import (@) { my $this=shift; IkiWiki::Setup::merge({@_}); - # Avoid overwriting any existing files. - foreach my $key (qw{srcdir destdir repository dumpsetup}) { - next unless exists $config{$key}; - my $add=""; - my $dir=IkiWiki::dirname($config{$key})."/"; - my $base=IkiWiki::basename($config{$key}); - while (-e $dir.$add.$base) { - $add=1 if ! $add; - $add++; + if (! $config{force_overwrite}) { + # Avoid overwriting any existing files. + foreach my $key (qw{srcdir destdir repository dumpsetup}) { + next unless exists $config{$key}; + my $add=""; + my $dir=IkiWiki::dirname($config{$key})."/"; + my $base=IkiWiki::basename($config{$key}); + while (-e $dir.$add.$base) { + $add=1 if ! $add; + $add++; + } + $config{$key}=$dir.$add.$base; } - $config{$key}=$dir.$add.$base; } # Set up wrapper diff --git a/debian/changelog b/debian/changelog index 1960a1226..bdbd818e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low * Rebuild wikis on upgrade to this version to get the comment counts added to existing pages. * Loosen regexp, to allow empty quoted parameters in directives. + * Add force_overwrite setting to make setup automator overwrite existing + files/directories. -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 -- cgit v1.2.3 From 6aaa6e0d245e450315a073f62e27c233cefbe9ec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Feb 2010 16:36:57 -0500 Subject: Fix admin openid detection in setup automator, and avoid prompting for a password. --- IkiWiki/Setup/Automator.pm | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 79a610e20..9da594e99 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -144,7 +144,7 @@ sub import (@) { # Create admin user(s). foreach my $admin (@{$config{adminuser}}) { - next if $admin=~/^http\?:\/\//; # openid + next if defined IkiWiki::openiduser($admin); # Prompt for password w/o echo. my ($password, $password2); diff --git a/debian/changelog b/debian/changelog index bdbd818e1..832bbaa85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low * Loosen regexp, to allow empty quoted parameters in directives. * Add force_overwrite setting to make setup automator overwrite existing files/directories. + * Fix admin openid detection in setup automator, and avoid prompting + for a password. -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 -- cgit v1.2.3 From aea5bf9b40f6676e93f987c28d9f2aa23608f5da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Mar 2010 14:51:47 -0400 Subject: reset setuptype to standard after an automator setup file is loaded so a standard file is generated (by default) --- IkiWiki/Setup/Automator.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9da594e99..9f694e18e 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -39,6 +39,7 @@ sub sanitize_wikiname ($) { sub import (@) { my $this=shift; IkiWiki::Setup::merge({@_}); + $config{setuptype}='Standard'; if (! $config{force_overwrite}) { # Avoid overwriting any existing files. -- cgit v1.2.3 From 440e18bc15389780833fc8b9c04116a97eeaeaa2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Mar 2010 14:59:21 -0400 Subject: reset setuptype first, actually so setup file can override default --- IkiWiki/Setup/Automator.pm | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9f694e18e..e9a572450 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -38,8 +38,8 @@ sub sanitize_wikiname ($) { sub import (@) { my $this=shift; - IkiWiki::Setup::merge({@_}); $config{setuptype}='Standard'; + IkiWiki::Setup::merge({@_}); if (! $config{force_overwrite}) { # Avoid overwriting any existing files. diff --git a/debian/changelog b/debian/changelog index e020b380f..4d0639a58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100313) UNRELEASED; urgency=low +ikiwiki (3.20100320) UNRELEASED; urgency=low * websetup: Add websetup_unsafe to allow marking other settings as unsafe. -- cgit v1.2.3 From 0d07bca315d19e6e957072004393138db6f33d3d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Mar 2010 17:17:07 -0400 Subject: fix printing of $@, which is clobbered by the call to gettext problem reported by viric --- IkiWiki/Setup/Automator.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index e9a572450..38e0d4422 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -124,9 +124,10 @@ sub import (@) { IkiWiki::run_hooks(checkconfig => sub { shift->() }); }; if ($@) { + my $err=$@; print STDERR sprintf(gettext("** Disabling plugin %s, since it is failing with this message:"), $plugin)."\n"; - print STDERR "$@\n"; + print STDERR "$err\n"; push @{$bakconfig{disable_plugins}}, $plugin; } } -- cgit v1.2.3 From 891238e075f0c4716ec8f51d5832745b0348ab77 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Mar 2010 11:54:18 -0400 Subject: add warning messages about bzr and mercurial hooks that are not correctly setup --- IkiWiki/Setup/Automator.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 38e0d4422..402212150 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -72,9 +72,11 @@ sub import (@) { } elsif ($config{rcs} eq 'bzr') { # TODO + print STDERR "warning: do not know how to set up the bzr_wrapper hook!\n"; } elsif ($config{rcs} eq 'mercurial') { # TODO + print STDERR "warning: do not know how to set up the mercurial_wrapper hook!\n"; } elsif ($config{rcs} eq 'cvs') { $config{cvs_wrapper}=$config{repository}."/CVSROOT/post-commit"; -- cgit v1.2.3 From e466d11fd363b4758bc4f624ff73664d89891f9e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Mar 2010 13:17:32 -0400 Subject: add warning about incomplete tla support --- IkiWiki/Setup/Automator.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 402212150..2dcb424e5 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -78,6 +78,10 @@ sub import (@) { # TODO print STDERR "warning: do not know how to set up the mercurial_wrapper hook!\n"; } + elsif ($config{rcs} eq 'tla') { + # TODO + print STDERR "warning: do not know how to set up the tla_wrapper hook!\n"; + } elsif ($config{rcs} eq 'cvs') { $config{cvs_wrapper}=$config{repository}."/CVSROOT/post-commit"; } -- cgit v1.2.3