3 # Copyright (C) 2005 Alex Schroeder <alex@emacswiki.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the
17 # Free Software Foundation, Inc.
18 # 59 Temple Place, Suite 330
19 # Boston, MA 02111-1307 USA
24 while ($data =~ /(\S+?): (.*?)(?=\n[^ \t]|\Z)/sg) {
25 my ($key, $value) = ($1, $2);
26 $value =~ s/\n\t/\n/g;
27 $result{$key} = $value;
32 # get this from $FullUrl in the current directory?
33 my $url = "http://www.communitywiki.org/cgi-bin/cw-en.pl";
35 my $RawDir = 'raw/trunk';
36 local $/ = undef; # Read complete files
39 foreach my $file (glob("$PageDir/*/*.pg $PageDir/*/.*.pg")) {
40 next unless $file =~ m
|/.*/(.+)\
.pg
$|;
42 mkdir($RawDir) or die "Cannot create $RawDir directory: $!"
44 open(F
, $file) or die "Cannot read $page file: $!";
47 my %result = ParseData
($data);
48 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
49 $atime,$mtime,$ctime,$blksize,$blocks) = stat("$RawDir/$page");
51 if ($mtime > $result{ts
}) {
52 print "Updating $page\n";
55 "-F", "text=<$RawDir/$page",
61 my $status = `svn status`;
62 foreach my $line (split(/\n/, $status)) {
63 if ($line =~ /([?ADM])\s+(\S+)/ and -f
$2) {
65 system("svn", "add", $2);
67 # nothing to do for M!
72 system("svn", "commit", "-m", "Update", "-q");