]> sipb.mit.edu Git - ikiwiki.git/commitdiff
fix moveprefs transition
authorJoey Hess <joey@gnu.kitenet.net>
Wed, 31 Dec 2008 19:54:22 +0000 (14:54 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Wed, 31 Dec 2008 19:54:22 +0000 (14:54 -0500)
doc/tips/upgrade_to_3.0.mdwn
ikiwiki-transition

index a9664dfc308a6d9fad28fa6c76f9eddcd16a8fca..8adc040a104fc834467eea4e1f7e2e272d8802c2 100644 (file)
@@ -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
 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.)
 
 
 (Make sure you have converted the setup file to the new format first.)
 
index b15d9f46b825a50ddd47bacff59ceb85c33edf2e..599261a093d798f818942e90577ff07a86d09a44 100755 (executable)
@@ -201,10 +201,15 @@ sub moveprefs {
                foreach my $admin (@{$config{adminuser}}) {
                        my $a=IkiWiki::userinfo_get($admin, $field);
                        if (defined $a && length $a &&
                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;
+                               }
                        }
                }
        }
                        }
                }
        }