From 794dbd24767c8ca856af22d280e3ce3a41e0d8d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Dec 2008 14:54:22 -0500 Subject: fix moveprefs transition --- doc/tips/upgrade_to_3.0.mdwn | 2 +- ikiwiki-transition | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/tips/upgrade_to_3.0.mdwn b/doc/tips/upgrade_to_3.0.mdwn index a9664dfc3..8adc040a1 100644 --- a/doc/tips/upgrade_to_3.0.mdwn +++ b/doc/tips/upgrade_to_3.0.mdwn @@ -21,7 +21,7 @@ setup file, and will no longer appear on the admin preferences page once your wiki is upgraded to 3.0. You can move these preferences into the setup file by running -`ikiwiki-transition moveprefs your.setup` +`ikiwiki-transition moveprefs your.setup; ikiwiki -setup your.setup -refresh -wrappers` (Make sure you have converted the setup file to the new format first.) diff --git a/ikiwiki-transition b/ikiwiki-transition index b15d9f46b..599261a09 100755 --- a/ikiwiki-transition +++ b/ikiwiki-transition @@ -201,10 +201,15 @@ sub moveprefs { foreach my $admin (@{$config{adminuser}}) { my $a=IkiWiki::userinfo_get($admin, $field); if (defined $a && length $a && - $a ne $orig && # might already have been moved - defined $config{$field} && - length $config{$field}) { - $config{$field}=IkiWiki::pagespec_merge($config{$field}, $a); + # might already have been moved + (! defined $orig || $a ne $orig)) { + if (defined $config{$field} && + length $config{$field}) { + $config{$field}=IkiWiki::pagespec_merge($config{$field}, $a); + } + else { + $config{$field}=$a; + } } } } -- cgit v1.2.3