aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-31 14:54:22 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-31 14:54:22 -0500
commit794dbd24767c8ca856af22d280e3ce3a41e0d8d7 (patch)
tree23db9b50221016eba9678ec9554b72ad0856e917
parent2b0473f09056120337637676f8f54bcd68c63442 (diff)
downloadikiwiki-794dbd24767c8ca856af22d280e3ce3a41e0d8d7.tar
ikiwiki-794dbd24767c8ca856af22d280e3ce3a41e0d8d7.tar.gz
fix moveprefs transition
-rw-r--r--doc/tips/upgrade_to_3.0.mdwn2
-rwxr-xr-xikiwiki-transition13
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;
+ }
}
}
}