Browse Source

give a shot at the new outdated status system

svn path=/branches/test/; revision=20237
tags/stw2018
nicoulas 8 years ago
parent
commit
b812b0f184
3 changed files with 20 additions and 16 deletions
  1. +1
    -1
      fsfe.xsl
  2. +17
    -13
      tools/build.pl
  3. +2
    -2
      tools/comptree.pl

+ 1
- 1
fsfe.xsl View File

@@ -736,7 +736,7 @@
</xsl:element><!-- end sister organisations-->
<div style="display: none">
a<xsl:value-of select="/buildinfo/document/outdated-info" />z
<xsl:copy-of select="/buildinfo/document/outdated-info" />
</div>
</div> <!-- /#footer -->

+ 17
- 13
tools/build.pl View File

@@ -336,7 +336,7 @@ sub process {
# Set the current date, to use for comparision in the XSLT.
#
$root->setAttribute("date", $current_date);
#
# Find original language. It's en, unless we're in the country specific
# se/, fr/, de/ and so on, directories.
@@ -347,9 +347,9 @@ sub process {
$srcfocus = "$1";
$root->setAttribute("original", $countries{$1});
}
$root->setAttribute("filename", "/$file");
#
# Set the directory name attribute
#
@@ -387,7 +387,7 @@ sub process {
my $backup = $dom->createElement("textsetbackup");
$root->appendChild($backup);
clone_document($backup, $opts{i}."/tools/texts-en.xml");
#
# Transform it, once for every focus!
#
@@ -616,7 +616,11 @@ sub process {
# register information about the outdated status
my $info = $dom->createElement("outdated-info");
$info->appendText($err);
foreach $line (split(/\n/, $err)) {
my $p = $dom->createElement("p");
$p->appendText($line);
$info->appendChild($p);
}
$document->appendChild($info);
if ($dir eq "global") {
@@ -786,23 +790,23 @@ foreach (grep(!/\.sources$/, grep(!/\.xsl$/, grep(!/\.xml$/, grep(!/\.xhtml$/,
sub clone_document {
my ($doc, $source) = @_;
my $root = $doc->parentNode;
print "Source: $source\n" if $opts{d};
foreach ($root->getElementsByTagName($doc->nodeName)) {
$root->removeChild($_);
$root->removeChild($_);
}
$root->appendChild($doc);
my $parser = XML::LibXML->new();
$parser->load_ext_dtd(0);
$parser->recover(1);
my $sourcedoc = $parser->parse_file($source);
foreach ($sourcedoc->documentElement->childNodes) {
$_->unbindNode();
my $n = $_->cloneNode(1);
$doc->appendChild($n);
$_->unbindNode();
my $n = $_->cloneNode(1);
$doc->appendChild($n);
}
if ($sourcedoc->documentElement->getAttribute("external")) {
$doc->setAttribute("external", "yes");

+ 2
- 2
tools/comptree.pl View File

@@ -17,7 +17,7 @@ use XML::LibXML;
sub areEqual {
my ($file1, $file2) = @_;
my $dom = XML::LibXML->load_xml(location => $file1);
my $don = XML::LibXML->load_xml(location => $file2);
@@ -83,7 +83,7 @@ sub nodesAreEqual {
if (not $nodes[$i]->nodeName eq $nodez[$i]->nodeName) {
return (false, "$file2: after common $commons, " . $nodes[$i]->nodeName . " != " . $nodez[$i]->nodeName );
}
$commons .= $nodes[$i]->nodeName
$commons .= $nodes[$i]->nodeName.","
}
# recur!

Loading…
Cancel
Save