blob: 16ad8951dec4971292658a5340a968211ca7cdc3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/usr/bin/perl
# MediaWiki -> RCS scraper
use warnings;
use strict;
require MediaWiki::DumpFile::Pages;
my $dumpfile = MediaWiki::DumpFile::Pages->new(shift @ARGV);
# 83Plus:Ports:57
while (defined (my $page = $dumpfile->next))
{
my @revs = $page->revision;
foreach (@revs) {
system("co", "-l", $page->title);
open (FILE, ">", $page->title);
print FILE $_->text;
close FILE;
my $user = $_->contributor->id;
if (!defined $user) {
$user = $_->contributor->ip;
$user =~ s/\./_/g;
$user = "ip_" . $user;
} else {
$user = "id_" . $user;
}
my @command = ("ci",
"-t-" . $page->title,
"-d" . $_->timestamp,
($_->comment ne "" ? "-m" . $_->comment : "-mNo message"),
"-r" . $_->id,
"-w" . $user,
$page->title,
);
print join " ", @command, "\n";
system(@command);
}
}
|