From bb93fccf0690344aa77f9538a508959a6de09847 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Dec 2008 15:22:16 -0500 Subject: Coding style change: Remove explcit vim folding markers. --- IkiWiki/Setup/Automator.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 88e9f3d24..9f2380d52 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -10,20 +10,20 @@ use IkiWiki::UserInfo; use Term::ReadLine; use File::Path; -sub ask ($$) { #{{{ +sub ask ($$) { my ($question, $default)=@_; my $r=Term::ReadLine->new("ikiwiki"); $r->readline($question." ", $default); -} #}}} +} -sub prettydir ($) { #{{{ +sub prettydir ($) { my $dir=shift; $dir=~s/^\Q$ENV{HOME}\E\//~\//; return $dir; -} #}}} +} -sub import (@) { #{{{ +sub import (@) { my $this=shift; IkiWiki::Setup::merge({@_}); @@ -142,6 +142,6 @@ sub import (@) { #{{{ print "To modify settings, edit ".prettydir($config{dumpsetup})." and then run:\n"; print " ikiwiki -setup ".prettydir($config{dumpsetup})."\n"; exit 0; -} #}}} +} 1 -- cgit v1.2.3 From 6d785d6401799bf929316cb070471601798de4c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Jan 2009 19:04:24 -0500 Subject: Add auto-blog.setup It will set up an ikiwiki instance tuned for use in blogging. As part of this change, move the example sites into /usr/share/ikiwiki so they are available even if docs are not installed. --- IkiWiki/Setup/Automator.pm | 12 +++++++++++- Makefile.PL | 10 ++++++++++ auto-blog.setup | 49 ++++++++++++++++++++++++++++++++++++++++++++++ auto.setup | 2 +- debian/changelog | 2 ++ debian/preinst | 4 ++++ debian/rules | 3 ++- 7 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 auto-blog.setup (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9f2380d52..b7798fcec 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -73,8 +73,18 @@ sub import (@) { print "\n\nSetting up $config{wikiname} ...\n"; - # Set up the repository. + # Set up the srcdir. mkpath($config{srcdir}) || die "mkdir $config{srcdir}: $!"; + # Copy in example wiki. + if (exists $config{example}) { + # cp -R is POSIX + # Another reason not to use -a is so that pages such as blog + # posts will not have old creation dates on this new wiki. + system("cp -R $IkiWiki::installdir/share/ikiwiki/examples/$config{example}/* $config{srcdir}"); + delete $config{example}; + } + + # Set up the repository. delete $config{repository} if ! $config{rcs} || $config{rcs}=~/bzr|mercurial/; if ($config{rcs}) { my @params=($config{rcs}, $config{srcdir}); diff --git a/Makefile.PL b/Makefile.PL index d92d54d1e..d29804cca 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -69,6 +69,15 @@ extra_install: install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \ fi \ done + + # Install example sites. + for dir in `cd doc/examples; find -type d ! -regex '.*\.svn.*'`; do \ + install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \ + done + for file in `cd doc/examples; find -type f ! -regex '.*\.svn.*'`; do \ + cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file || \ + install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \ + done for dir in `find templates -follow -type d ! -regex '.*\.svn.*'`; do \ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \ @@ -111,6 +120,7 @@ extra_install: -install -d $(DESTDIR)/etc/ikiwiki -install -m 0644 wikilist $(DESTDIR)/etc/ikiwiki -install -m 0644 auto.setup $(DESTDIR)/etc/ikiwiki + -install -m 0644 auto-blog.setup $(DESTDIR)/etc/ikiwiki } } diff --git a/auto-blog.setup b/auto-blog.setup new file mode 100644 index 000000000..35a6fc161 --- /dev/null +++ b/auto-blog.setup @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# Ikiwiki setup automator -- blog version. +# +# This setup file causes ikiwiki to create a wiki, containing a blog, +# check it into revision control, generate a setup file for the new +# wiki, and set everything up. +# +# Just run: ikiwiki -setup /etc/ikiwiki/auto-blog.setup +# +# By default, it asks a few questions, and confines itself to the user's home +# directory. You can edit it to change what it asks questions about, or to +# modify the values to use site-specific settings. + +require IkiWiki::Setup::Automator; + +our $wikiname=IkiWiki::Setup::Automator::ask( + gettext("What will the blog be named?"), gettext("blog")); +our $rcs=IkiWiki::Setup::Automator::ask( + gettext("What revision control system to use?"), "git"); +our $admin=IkiWiki::Setup::Automator::ask( + gettext("What wiki user (or openid) will be admin?"), $ENV{USER}); +use Net::Domain q{hostfqdn}; +our $domain=hostfqdn() || ikiwiki::setup::automator::ask( + gettext("What is the domain name of the web server?"), ""); + +IkiWiki::Setup::Automator->import( + wikiname => $wikiname, + adminuser => [$admin], + rcs => $rcs, + srcdir => "$ENV{HOME}/$wikiname", + destdir => "$ENV{HOME}/public_html/$wikiname", + repository => "$ENV{HOME}/$wikiname.".($rcs eq "monotone" ? "mtn" : $rcs), + dumpsetup => "$ENV{HOME}/$wikiname.setup", + url => "http://$domain/~$ENV{USER}/$wikiname", + cgiurl => "http://$domain/~$ENV{USER}/$wikiname/ikiwiki.cgi", + cgi_wrapper => "$ENV{HOME}/public_html/$wikiname/ikiwiki.cgi", + adminemail => "$ENV{USER}\@$domain", + add_plugins => [qw{goodstuff websetup comments}], + disable_plugins => [qw{}], + libdir => "$ENV{HOME}/.ikiwiki", + rss => 1, + atom => 1, + syslog => 1, + hardlink => 1, + + example => "blog", + comments_pagespec => "posts/* and !*/Discussion", + discussion => 0, +) diff --git a/auto.setup b/auto.setup index 9cf5e7725..1231309b2 100644 --- a/auto.setup +++ b/auto.setup @@ -17,7 +17,7 @@ our $wikiname=IkiWiki::Setup::Automator::ask( our $rcs=IkiWiki::Setup::Automator::ask( gettext("What revision control system to use?"), "git"); our $admin=IkiWiki::Setup::Automator::ask( - gettext("What wiki user (or openid) will be wiki admin?"), $ENV{USER}); + gettext("What wiki user (or openid) will be admin?"), $ENV{USER}); use Net::Domain q{hostfqdn}; our $domain=hostfqdn() || ikiwiki::setup::automator::ask( gettext("What is the domain name of the web server?"), ""); diff --git a/debian/changelog b/debian/changelog index 9f6790ceb..f35606148 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,8 @@ ikiwiki (3.02) UNRELEASED; urgency=low the nostromo web server. * Recommend libterm-readline-gnu-perl since that makes auto.setup behave better. + * Add auto-blog.setup, which will set up an ikiwiki instance tuned for use + in blogging. -- Joey Hess Tue, 06 Jan 2009 15:02:52 -0500 diff --git a/debian/preinst b/debian/preinst index c588901df..4158b2ae6 100755 --- a/debian/preinst +++ b/debian/preinst @@ -14,3 +14,7 @@ if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 1.2; then fi fi fi +if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 3.02; then + # replaced by symlink + rm -rf /usr/share/doc/ikiwiki/examples +fi diff --git a/debian/rules b/debian/rules index 25b1f57b6..2434d92c8 100755 --- a/debian/rules +++ b/debian/rules @@ -25,8 +25,9 @@ binary-indep: build dh_clean -k $(MAKE) pure_install DESTDIR=$(shell pwd)/debian/ikiwiki dh_installdocs html - dh_installexamples doc/examples/* + dh_link usr/share/ikiwiki/examples usr/share/doc/ikiwiki/examples dh_link usr/share/common-licenses/GPL-2 usr/share/doc/ikiwiki/html/GPL + dh_installexamples dh_installchangelogs dh_compress -X html dh_fixperms -- cgit v1.2.3 From 639f464cb3c703697db2a8887ab32d7a8233508f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Jan 2009 14:52:49 -0500 Subject: Avoid feeding decoded unicode to Term::ReadLine That resulted in double encoded display when using perl's stub readline module. Apparently that module unconditionally upgrades text to utf8, in a quite braindead way. (Term::ReadLine::Gnu::Perl worked ok.) --- IkiWiki/Setup/Automator.pm | 3 ++- debian/changelog | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index b7798fcec..42caf3039 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -9,12 +9,13 @@ use IkiWiki; use IkiWiki::UserInfo; use Term::ReadLine; use File::Path; +use Encode; sub ask ($$) { my ($question, $default)=@_; my $r=Term::ReadLine->new("ikiwiki"); - $r->readline($question." ", $default); + $r->readline(encode_utf8($question)." ", $default); } sub prettydir ($) { diff --git a/debian/changelog b/debian/changelog index 013dc1884..6e8a54d9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.03) UNRELEASED; urgency=low + + * Avoid feeding decoded unicode to Term::ReadLine. + Closes: 512169 + + -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 + ikiwiki (3.02) unstable; urgency=low * blogspam: New plugin, adding spam filtering for page editing / comment -- cgit v1.2.3 From 8682daad58023fd6297945d602d2044f3e8f063f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Feb 2009 16:30:39 -0500 Subject: Setup automator: Prompt for password twice. Closes: #516973 --- IkiWiki/Setup/Automator.pm | 13 +++++++++++-- debian/changelog | 1 + po/de.po | 16 ++++++++-------- po/es.po | 33 +++++++++++++++++++-------------- po/ikiwiki.pot | 14 +++++++------- 5 files changed, 46 insertions(+), 31 deletions(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 42caf3039..b63c8e245 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -110,11 +110,20 @@ sub import (@) { next if $admin=~/^http\?:\/\//; # openid # Prompt for password w/o echo. + my ($password, $password2); system('stty -echo 2>/dev/null'); local $|=1; print "\n\nCreating wiki admin $admin ...\n"; - print "Choose a password: "; - chomp(my $password=); + for (;;) { + print "Choose a password: "; + chomp($password=); + print "Confirm password: "; + chomp($password2=); + + last if $password2 ne $password; + + print "Password mismatch.\n\n"; + } print "\n\n\n"; system('stty sane 2>/dev/null'); diff --git a/debian/changelog b/debian/changelog index a650529eb..1dc01878b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ikiwiki (3.05) UNRELEASED; urgency=low * Add noextension parameter to htmlize hooks to support, eg, Makefile. * Add tagged() PageSpec. * Updated German translation (Kai Wasserbäch). Closes: #516770 + * Setup automator: Prompt for password twice. Closes: #516973 -- Joey Hess Sun, 15 Feb 2009 20:11:57 -0500 diff --git a/po/de.po b/po/de.po index 1c45c73dc..25ec8b5c0 100644 --- a/po/de.po +++ b/po/de.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.04\n" -"Report-Msgid-Bugs-To: ikiwiki@packages.debian.org\n" -"POT-Creation-Date: 2009-02-14 03:04-0500\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-02-24 16:31-0500\n" "PO-Revision-Date: 2009-02-20 17:44+0100\n" "Last-Translator: Kai Wasserbäch \n" "Language-Team: German \n" @@ -47,7 +47,7 @@ msgstr "Einstellungen gespeichert." msgid "You are banned." msgstr "Sie sind ausgeschlossen worden." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1209 msgid "Error" msgstr "Fehler" @@ -818,16 +818,16 @@ msgstr "Direkter Daten-Download" msgid "parse fail at line %d: %s" msgstr "Verarbeitungsfehler in Zeile %d: %s" -#: ../IkiWiki/Plugin/template.pm:28 +#: ../IkiWiki/Plugin/template.pm:29 msgid "missing id parameter" msgstr "fehlender »id«-Parameter" -#: ../IkiWiki/Plugin/template.pm:35 +#: ../IkiWiki/Plugin/template.pm:36 #, perl-format msgid "template %s not found" msgstr "Vorlage %s nicht gefunden" -#: ../IkiWiki/Plugin/template.pm:54 +#: ../IkiWiki/Plugin/template.pm:55 msgid "failed to process:" msgstr "Verarbeitung fehlgeschlagen von:" @@ -1040,12 +1040,12 @@ msgstr "" msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Laden der für %s benötigten externen Erweiterung fehlgeschlagen: %s" -#: ../IkiWiki.pm:1187 +#: ../IkiWiki.pm:1192 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Präprozessorschleife auf %s in Tiefe %i erkannt" -#: ../IkiWiki.pm:1725 +#: ../IkiWiki.pm:1730 msgid "yes" msgstr "ja" diff --git a/po/es.po b/po/es.po index 7991ba2d6..e18f146d4 100644 --- a/po/es.po +++ b/po/es.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-14 03:04-0500\n" +"POT-Creation-Date: 2009-02-24 16:31-0500\n" "PO-Revision-Date: 2009-02-16 10:22+0100\n" "Last-Translator: Víctor Moral \n" "Language-Team: spanish \n" @@ -25,7 +25,8 @@ msgstr "Antes es necesario identificarse." #: ../IkiWiki/CGI.pm:145 msgid "login failed, perhaps you need to turn on cookies?" -msgstr "registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" +msgstr "" +"registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" #: ../IkiWiki/CGI.pm:163 ../IkiWiki/CGI.pm:294 msgid "Your login session has expired." @@ -51,7 +52,7 @@ msgstr "Las preferencias se han guardado." msgid "You are banned." msgstr "Ha sido expulsado." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1209 msgid "Error" msgstr "Error" @@ -61,7 +62,8 @@ msgstr "Contenido añadido activado vía web." #: ../IkiWiki/Plugin/aggregate.pm:93 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" +msgstr "" +"¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" #: ../IkiWiki/Plugin/aggregate.pm:220 #, perl-format @@ -350,7 +352,8 @@ msgstr "" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" -msgstr "Error en el análisis del URL, no puedo determinar el nombre del dominio" +msgstr "" +"Error en el análisis del URL, no puedo determinar el nombre del dominio" #: ../IkiWiki/Plugin/goto.pm:49 msgid "missing page" @@ -441,7 +444,8 @@ msgstr "La página %s está bloqueada y no puede modificarse" #: ../IkiWiki/Plugin/mdwn.pm:44 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed" -msgstr "el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" +msgstr "" +"el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" #: ../IkiWiki/Plugin/mdwn.pm:67 #, perl-format @@ -816,16 +820,16 @@ msgstr "Enlace directo para descarga" msgid "parse fail at line %d: %s" msgstr "error de análisis en la línea %d: %s" -#: ../IkiWiki/Plugin/template.pm:28 +#: ../IkiWiki/Plugin/template.pm:29 msgid "missing id parameter" msgstr "falta el parámetro \"id\"" -#: ../IkiWiki/Plugin/template.pm:35 +#: ../IkiWiki/Plugin/template.pm:36 #, perl-format msgid "template %s not found" msgstr "no he encontrado la plantilla %s" -#: ../IkiWiki/Plugin/template.pm:54 +#: ../IkiWiki/Plugin/template.pm:55 msgid "failed to process:" msgstr "se ha producido un error fatal mientras procesaba la plantilla:" @@ -863,7 +867,8 @@ msgid "plugins" msgstr "complementos" #: ../IkiWiki/Plugin/websetup.pm:395 -msgid "The configuration changes shown below require a wiki rebuild to take effect." +msgid "" +"The configuration changes shown below require a wiki rebuild to take effect." msgstr "" "Los cambios en la configuración que se muestran más abajo precisan una " "reconstrucción del wiki para tener efecto." @@ -979,7 +984,8 @@ msgstr "el programa %s no parece ser ejecutable" #: ../IkiWiki/Wrapper.pm:20 msgid "cannot create a wrapper that uses a setup file" -msgstr "no puedo crear un programa envoltorio que utiliza un archivo de configuración" +msgstr "" +"no puedo crear un programa envoltorio que utiliza un archivo de configuración" #: ../IkiWiki/Wrapper.pm:24 msgid "wrapper filename not specified" @@ -1036,14 +1042,14 @@ msgstr "no puedo emplear varios complementos rcs" msgid "failed to load external plugin needed for %s plugin: %s" msgstr "no he podido cargar el complemento externo %s necesario para %s" -#: ../IkiWiki.pm:1187 +#: ../IkiWiki.pm:1192 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" "se ha detectado en la página %s un bucle de preprocesado en la iteración " "número %i" -#: ../IkiWiki.pm:1725 +#: ../IkiWiki.pm:1730 msgid "yes" msgstr "si" @@ -1068,4 +1074,3 @@ msgstr "" #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "¿ Cuál es el dominio para el servidor web ?" - diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index a0fef590c..4ef0c23d1 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-14 03:04-0500\n" +"POT-Creation-Date: 2009-02-24 16:31-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,7 +48,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1209 msgid "Error" msgstr "" @@ -801,16 +801,16 @@ msgstr "" msgid "parse fail at line %d: %s" msgstr "" -#: ../IkiWiki/Plugin/template.pm:28 +#: ../IkiWiki/Plugin/template.pm:29 msgid "missing id parameter" msgstr "" -#: ../IkiWiki/Plugin/template.pm:35 +#: ../IkiWiki/Plugin/template.pm:36 #, perl-format msgid "template %s not found" msgstr "" -#: ../IkiWiki/Plugin/template.pm:54 +#: ../IkiWiki/Plugin/template.pm:55 msgid "failed to process:" msgstr "" @@ -1012,12 +1012,12 @@ msgstr "" msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1187 +#: ../IkiWiki.pm:1192 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1725 +#: ../IkiWiki.pm:1730 msgid "yes" msgstr "" -- cgit v1.2.3 From 062f87ce3807155ff57bf316685f9bb500726867 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 Mar 2009 15:01:08 -0500 Subject: Setup automator: Fix bug in password comparison. Closes: #517654 --- IkiWiki/Setup/Automator.pm | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Setup/Automator.pm') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index b63c8e245..7d9eca3af 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -120,7 +120,7 @@ sub import (@) { print "Confirm password: "; chomp($password2=); - last if $password2 ne $password; + last if $password2 eq $password; print "Password mismatch.\n\n"; } diff --git a/debian/changelog b/debian/changelog index 4e62b0971..82445e837 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.06) UNRELEASED; urgency=low + + * Setup automator: Fix bug in password comparison. Closes: #517654 + + -- Joey Hess Sun, 01 Mar 2009 15:00:39 -0500 + ikiwiki (3.05) unstable; urgency=low * debhelper v7(.0.50); rules file minimisation. -- cgit v1.2.3