From: Dietmar Maurer Date: Fri, 14 Oct 2016 06:07:15 +0000 (+0200) Subject: pve-docs-mediawiki-import.in: correctly pass category parameter X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=commitdiff_plain;h=c5bf6350d8bed970ae5967f372dc0538d337709d pve-docs-mediawiki-import.in: correctly pass category parameter --- diff --git a/pve-docs-mediawiki-import.in b/pve-docs-mediawiki-import.in index 5ba556b..1a3f6b4 100755 --- a/pve-docs-mediawiki-import.in +++ b/pve-docs-mediawiki-import.in @@ -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