]> git.proxmox.com Git - pve-docs.git/commitdiff
pve-docs-mediawiki-import.in: correctly pass category parameter
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 14 Oct 2016 06:07:15 +0000 (08:07 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 14 Oct 2016 06:09:18 +0000 (08:09 +0200)
pve-docs-mediawiki-import.in

index 5ba556bec3f5692086fd8bd6e6e37f599000618c..1a3f6b48bb974fd0f2a43878b0dd9ce8135181b4 100755 (executable)
@@ -17,7 +17,7 @@ my $fileinfo = decode_json($data_str);
 
 my $config_fn = "/root/.pve-docs"; # format 'username:pw'
 
-my $fh = IO::File->new("$config_fn") || 
+my $fh = IO::File->new("$config_fn") ||
     die "Please configure the mediawiki user/passswd in '$config_fn'\n";
 
 my $api_url = "http://localhost/mediawiki/api.php";
@@ -55,7 +55,7 @@ sub update_page {
            $page .= "\n[[$catstr]]\n";
        }
     }
-    
+
     my $timestamp = $ref->{timestamp};
     my $wcmd = {
        action => 'edit',
@@ -64,7 +64,7 @@ sub update_page {
        text => $page,
     };
 
-    $mw->edit($wcmd) || 
+    $mw->edit($wcmd) ||
        die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
 }
 
@@ -79,8 +79,8 @@ foreach my $source (sort keys %{$fileinfo->{toplevel}->{wiki}}) {
 
     my $path = "/usr/share/pve-docs/$filename";
     die "no such file '$path'" if ! -f $path;
-    
-    update_page($title, $filename, category => $cat_refdoc);
+
+    update_page($title, $filename, $cat_refdoc);
 }
 
 # also update 'Get support' page, because this is used since a long