mirror of https://github.com/encounter/SDL.git
fnsince.pl: Don't print out the version numbers if updating the wiki.
This commit is contained in:
parent
85edbc92ac
commit
179a04f85a
|
@ -101,63 +101,64 @@ $funcs{'SDL_WinRTGetFSPathUNICODE'} = '2.0.3';
|
||||||
$funcs{'SDL_WinRTGetFSPathUTF8'} = '2.0.3';
|
$funcs{'SDL_WinRTGetFSPathUTF8'} = '2.0.3';
|
||||||
$funcs{'SDL_WinRTRunApp'} = '2.0.3';
|
$funcs{'SDL_WinRTRunApp'} = '2.0.3';
|
||||||
|
|
||||||
foreach my $release (@releases) {
|
if (not defined $wikipath) {
|
||||||
foreach my $fn (sort keys %funcs) {
|
foreach my $release (@releases) {
|
||||||
print("$fn: $funcs{$fn}\n") if $funcs{$fn} eq $release;
|
foreach my $fn (sort keys %funcs) {
|
||||||
}
|
print("$fn: $funcs{$fn}\n") if $funcs{$fn} eq $release;
|
||||||
}
|
|
||||||
|
|
||||||
if (defined $wikipath) {
|
|
||||||
chdir($wikipath);
|
|
||||||
foreach my $fn (keys %funcs) {
|
|
||||||
my $revision = $funcs{$fn};
|
|
||||||
$revision = 'git HEAD (in development, not in an official release yet)' if $revision eq 'HEAD';
|
|
||||||
my $fname = "$fn.mediawiki";
|
|
||||||
if ( ! -f $fname ) {
|
|
||||||
#print STDERR "No such file: $fname\n";
|
|
||||||
next;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (defined $wikipath) {
|
||||||
|
chdir($wikipath);
|
||||||
|
foreach my $fn (keys %funcs) {
|
||||||
|
my $revision = $funcs{$fn};
|
||||||
|
$revision = 'git HEAD (in development, not in an official release yet)' if $revision eq 'HEAD';
|
||||||
|
my $fname = "$fn.mediawiki";
|
||||||
|
if ( ! -f $fname ) {
|
||||||
|
#print STDERR "No such file: $fname\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
my @lines = ();
|
my @lines = ();
|
||||||
open(FH, '<', $fname) or die("Can't open $fname for read: $!\n");
|
open(FH, '<', $fname) or die("Can't open $fname for read: $!\n");
|
||||||
my $added = 0;
|
my $added = 0;
|
||||||
while (<FH>) {
|
while (<FH>) {
|
||||||
chomp;
|
chomp;
|
||||||
if ((/\A\-\-\-\-/) && (!$added)) {
|
if ((/\A\-\-\-\-/) && (!$added)) {
|
||||||
|
push @lines, "== Version ==";
|
||||||
|
push @lines, "";
|
||||||
|
push @lines, "This function is available since SDL $revision.";
|
||||||
|
push @lines, "";
|
||||||
|
$added = 1;
|
||||||
|
}
|
||||||
|
push @lines, $_;
|
||||||
|
next if not /\A\=\=\s+Version\s+\=\=/;
|
||||||
|
$added = 1;
|
||||||
|
push @lines, "";
|
||||||
|
push @lines, "This function is available since SDL $revision.";
|
||||||
|
push @lines, "";
|
||||||
|
while (<FH>) {
|
||||||
|
chomp;
|
||||||
|
next if not (/\A\=\=\s+/ || /\A\-\-\-\-/);
|
||||||
|
push @lines, $_;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(FH);
|
||||||
|
|
||||||
|
if (!$added) {
|
||||||
push @lines, "== Version ==";
|
push @lines, "== Version ==";
|
||||||
push @lines, "";
|
push @lines, "";
|
||||||
push @lines, "This function is available since SDL $revision.";
|
push @lines, "This function is available since SDL $revision.";
|
||||||
push @lines, "";
|
push @lines, "";
|
||||||
$added = 1;
|
|
||||||
}
|
}
|
||||||
push @lines, $_;
|
|
||||||
next if not /\A\=\=\s+Version\s+\=\=/;
|
open(FH, '>', $fname) or die("Can't open $fname for write: $!\n");
|
||||||
$added = 1;
|
foreach (@lines) {
|
||||||
push @lines, "";
|
print FH "$_\n";
|
||||||
push @lines, "This function is available since SDL $revision.";
|
|
||||||
push @lines, "";
|
|
||||||
while (<FH>) {
|
|
||||||
chomp;
|
|
||||||
next if not (/\A\=\=\s+/ || /\A\-\-\-\-/);
|
|
||||||
push @lines, $_;
|
|
||||||
last;
|
|
||||||
}
|
}
|
||||||
|
close(FH);
|
||||||
}
|
}
|
||||||
close(FH);
|
|
||||||
|
|
||||||
if (!$added) {
|
|
||||||
push @lines, "== Version ==";
|
|
||||||
push @lines, "";
|
|
||||||
push @lines, "This function is available since SDL $revision.";
|
|
||||||
push @lines, "";
|
|
||||||
}
|
|
||||||
|
|
||||||
open(FH, '>', $fname) or die("Can't open $fname for write: $!\n");
|
|
||||||
foreach (@lines) {
|
|
||||||
print FH "$_\n";
|
|
||||||
}
|
|
||||||
close(FH);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue