<?xml version="1.0" encoding="ISO-8859-1" ?>

<!--
# Copyright 2002-2003 Raphaël Hertzog
# This file is distributed under the terms of the General Public License
# version 2 or (at your option) any later version.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output encoding="UTF-8" method="html"/>

<xsl:param name="package"/>
<xsl:param name="dir"/>
<xsl:param name="date"/>
<xsl:param name="hasoldstable" select="''"/>
<xsl:param name="hasstable" select="''"/>
<xsl:param name="hastesting" select="''"/>
<xsl:param name="hasunstable" select="''"/>
<xsl:param name="hasexperimental" select="''"/>
<xsl:param name="hasother" select="''"/>
<xsl:param name="hass-p-u" select="''"/>
<xsl:param name="hast-p-u" select="''"/>
<xsl:param name="hasoldstable-security" select="''"/>
<xsl:param name="hasstable-security" select="''"/>
<xsl:param name="hastesting-security" select="''"/>
<xsl:param name="hasnews" select="''"/>
<xsl:param name="hasexcuse" select="''"/>

<xsl:variable name="other" select="document(concat('../base/', $dir, '/other.xml'))/other"/>

<!-- Those variables controls the todo and problem item concerning
     standards-version not being up to date -->
<xsl:variable name="lastsv" select="'3.6.1'"/>
<xsl:variable name="lastmajorsv" select="'3.'"/>

<!-- Named templates aka functions -->
<xsl:template name="mirror">
  <xsl:choose>
    <xsl:when test="contains(/source/section, 'non-US')">
      <xsl:text>http://non-us.debian.org/debian-non-US</xsl:text>  
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>http://http.us.debian.org/debian</xsl:text>  
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="outputitem">
  <xsl:choose>
    <xsl:when test="@url">
      <li><xsl:if test="@date">
        <xsl:text>[</xsl:text>
	<xsl:value-of select="@date"/>
        <xsl:text>] </xsl:text>
      </xsl:if><a href="{@url}">
      <xsl:value-of select="text()"/></a><xsl:if test="@from">
        <xsl:text> (</xsl:text>
	<xsl:value-of select="@from"/>
        <xsl:text>)</xsl:text></xsl:if></li>
    </xsl:when>
    <xsl:otherwise>
      <li><xsl:if test="@date">
        <xsl:text>[</xsl:text>
	<xsl:value-of select="@date"/>
        <xsl:text>] </xsl:text>
      </xsl:if><xsl:value-of select="text()"/></li>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<!-- Convert + in %2b for URL escaping ... -->
<xsl:template name="escape-name">
  <xsl:param name="text"/>
  <xsl:if test="contains($text,'+')">
    <xsl:value-of select="substring-before($text,'+')"/>
    <xsl:text>%2b</xsl:text>
    <xsl:call-template name="escape-name">
    <xsl:with-param name="text"><xsl:value-of select="substring-after($text,'+')"/></xsl:with-param>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="not(contains($text,'+'))">
    <xsl:value-of select="$text"/>
  </xsl:if>
</xsl:template>


<!-- All the work is done in a single template -->
<xsl:template match="source">

  <!-- Start of html -->
  <html>
  <head>
  <meta name="ROBOTS" content="NOFOLLOW"/>
  <link title="Default" rel="stylesheet" href="../common/pts.css"/>
  <link title="Standard link rendering" rel="alternate stylesheet" href="../common/pts2.css"/>
  <title>Overview of <xsl:value-of select="$package"/> source package</title>
  </head>
  <body>
  
  <form method="get" action="/common/index.html" style="float: right;">
  <!-- this link should make lynx/links happy [FG] -->
  Jump to package (<a href="/">home page</a>): <br/>
  <input type="text" name="src" value=""/>
  </form>
  <h1>Overview of <xsl:value-of select="$package"/> source package</h1>

  <table class="containertable">
  <tr class="containerrow" valign="top">
  <td class="containercell">
  <!-- LEFT SIDE -->
  <table class="lefttable">
  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  General Information
  </td></tr>
  <tr class="normalrow">
  <td class="labelcell">Last version</td>
  <td class="contentcell"><xsl:value-of select="version"/></td>
  </tr>
  <xsl:if test="@release!='unstable'">
  <tr class="normalrow">
  <td class="labelcell">Distribution</td>
  <td class="contentcell"><xsl:value-of select="@release"/></td>
  </tr>
  </xsl:if>
  <tr class="normalrow">
  <td class="labelcell">Maintainer</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://qa.debian.org/developer.php?login=</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="maintainer/email"/></xsl:with-param>
      </xsl:call-template>
    </xsl:attribute>
    <xsl:value-of select="maintainer/name"/>
  </xsl:element>
  [<a class="email" href="mailto:{maintainer/email}">mail</a>]
  </td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell"><a href="http://www.debian.org/doc/manuals/developers-reference/ch-pkgs.en.html#s-collaborative-maint">Co-Maintainers</a></td>
  <td class="contentcell">
  <xsl:if test="uploaders">
    <xsl:for-each select="uploaders/item">
      <a class="email" href="http://qa.debian.org/developer.php?login={email}"><xsl:value-of select="name"/></a> [<a class="email" href="mailto:{email}">mail</a>]<br/>
    </xsl:for-each>
  </xsl:if>
  <xsl:if test="not(uploaders)">
    <a class="none" title="You should find some co-maintainers ..." name="fake">None</a>
  </xsl:if>
  </td></tr>
  <tr class="normalrow">
  <td class="labelcell">Standards-Version</td>
  <td class="contentcell"><xsl:value-of select="standards-version"/></td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell">Priority &amp; Section</td>
  <td class="contentcell"><xsl:value-of select="priority"/> - <xsl:value-of select="section"/></td>
  </tr>
  <xsl:if test="architecture!='any' and architecture!='all'">
  <tr class="normalrow">
  <td class="labelcell">Architecture</td>
  <td class="contentcell"><xsl:value-of select="architecture"/></td>
  </tr>
  </xsl:if>
  
  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  Bugs Count
  </td></tr>
  <tr class="normalrow">
  <td class="labelcell">All bugs</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://bugs.debian.org/src:</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
      </xsl:call-template>
    </xsl:attribute>
    <xsl:if test="$hasother">
      <xsl:value-of select="$other/bugs/@all"/>
    </xsl:if>
  </xsl:element>
  </td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell">Release Critical</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data=</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
      </xsl:call-template>
      <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious</xsl:text>
    </xsl:attribute>
    <xsl:if test="$hasother">
      <xsl:value-of select="$other/bugs/@rc"/>
    </xsl:if>
  </xsl:element>
  </td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell">Important and Normal</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data=</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
      </xsl:call-template>
      <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=important&amp;sev-inc=normal</xsl:text>
    </xsl:attribute>
    <xsl:if test="$hasother">
      <xsl:value-of select="$other/bugs/@normal"/>
    </xsl:if>
  </xsl:element>
  </td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell">Minor and Wishlist</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data=</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
      </xsl:call-template>
      <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=minor&amp;sev-inc=wishlist</xsl:text>
    </xsl:attribute>
    <xsl:if test="$hasother">
      <xsl:value-of select="$other/bugs/@wishlist"/>
    </xsl:if>
  </xsl:element>
  </td>
  </tr>
  <tr class="normalrow">
  <td class="labelcell">Fixed and Pending</td>
  <td class="contentcell">
  <xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data=</xsl:text>
      <xsl:call-template name="escape-name">
        <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
      </xsl:call-template>
      <xsl:text>&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed</xsl:text>
    </xsl:attribute>
    <xsl:if test="$hasother">
      <xsl:value-of select="$other/bugs/@fixed"/>
    </xsl:if>
  </xsl:element>
  </td>
  </tr>

  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  Subscription - <a class="titlelink" href="http://www.debian.org/doc/manuals/developers-reference/ch-resources.en.html#s-pkg-tracking-system">Package Tracking System</a>
  </td></tr>
  <tr class="normalrow">
  <td class="labelcell">Subscribers count</td>
  <td class="contentcell"><xsl:if test="$hasother">
    <xsl:value-of select="$other/pts/@count"/>
  </xsl:if></td>
  </tr>
  <tr class="normalrow">
  <td class="contentcell" colspan="2">
  <form method="post" action="/cgi-bin/pts.cgi">
    <input type="hidden" name="package" value="{$package}"/>
    <select name="what">
      <option value="subscribe">Subscribe</option>
      <option value="unsubscribe">Unsubscribe</option>
      <option value="advanced">Advanced mode</option>
    </select>
    <input type="text" name="email" size="15" value="your email" onFocus="if(email.value=='your email'){{email.value=''}}"/>
    <input type="submit" name="submit" value="Send"/>
  </form>
  </td>
  </tr>

  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  Binary Package(s)
  </td></tr>
  <tr class="normalrow">
  <td class="normalcell" colspan="2" style="text-align: left">
  <xsl:for-each select="binary/item">
    <xsl:sort select="text()"/>
    <xsl:variable name="pkg" select="text()"/>
    <li>
    <a href="http://packages.debian.org/{text()}"><xsl:value-of select="text()"/></a>
    <span style="font-size: 70%">
    (<a href="http://bugs.debian.org/{text()}"><xsl:value-of select="$other/bugs/item[@name=$pkg]/@all"/> bugs</a>: 

      <xsl:element name="a">
	<xsl:attribute name="title">critical, grave and serious</xsl:attribute>
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
	  <xsl:call-template name="escape-name">
	    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
	  </xsl:call-template>
	  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious</xsl:text>
	</xsl:attribute>
	<xsl:value-of select="$other/bugs/item[@name=$pkg]/@rc"/>
      </xsl:element>, 

      <xsl:element name="a">
	<xsl:attribute name="title">important and normal</xsl:attribute>
	<xsl:attribute name="href">
	<xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
	<xsl:call-template name="escape-name">
	  <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
	</xsl:call-template>
	<xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=important&amp;sev-inc=normal</xsl:text>
	</xsl:attribute>
	<xsl:value-of select="$other/bugs/item[@name=$pkg]/@normal"/>
      </xsl:element>, 
      
      <xsl:element name="a">
	<xsl:attribute name="title">wishlist and minor</xsl:attribute>
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
	  <xsl:call-template name="escape-name">
	    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
	  </xsl:call-template>
	  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=minor&amp;sev-inc=wishlist</xsl:text>
	</xsl:attribute>
	<xsl:value-of select="$other/bugs/item[@name=$pkg]/@wishlist"/>
      </xsl:element>, 

      <xsl:element name="a">
	<xsl:attribute name="title">pending and fixed</xsl:attribute>
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
	  <xsl:call-template name="escape-name">
	    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
	  </xsl:call-template>
	  <xsl:text>&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed</xsl:text>
	</xsl:attribute>
	<xsl:value-of select="$other/bugs/item[@name=$pkg]/@fixed"/>
      </xsl:element>)
    </span>
    </li>
  </xsl:for-each>
  </td></tr>

  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  Other available versions
  </td></tr>
  <xsl:if test="$hasexperimental">
  <tr class="normalrow">
  <td class="labelcell">Experimental</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/experimental.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hasoldstable-security">
  <tr class="normalrow">
  <td class="labelcell">Security Updates (oldstable)</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/oldstable-security.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hasstable-security">
  <tr class="normalrow">
  <td class="labelcell">Security Updates (stable)</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/stable-security.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hastesting-security">
  <tr class="normalrow">
  <td class="labelcell">Security Updates (testing)</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/testing-security.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hastesting">
  <tr class="normalrow">
  <td class="labelcell"><a href="http://www.debian.org/releases/testing/">Testing</a></td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/testing.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hast-p-u">
  <tr class="normalrow">
  <td class="labelcell">Testing Proposed Updates</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/t-p-u.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hasoldstable">  
  <tr class="normalrow">
  <td class="labelcell"><a href="http://www.debian.org/releases/stable/">Stable</a></td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/stable.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hasstable">  
  <tr class="normalrow">
  <td class="labelcell"><a href="http://www.debian.org/releases/stable/">Stable</a></td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/stable.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
  <xsl:if test="$hass-p-u">  
  <tr class="normalrow">
  <td class="labelcell">Stable Proposed Updates</td>
  <td class="contentcell">
  <xsl:value-of select="document(concat('../base/', $dir, '/s-p-u.xml'))/source/version"/>
  </td>
  </tr>
  </xsl:if>
 
  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  Other links
  </td></tr>
  <tr>
  <td class="contentcell" colspan="2" style="text-align: left">
  <xsl:if test="architecture!='all'">
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://buildd.debian.org/build.php?pkg=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        <xsl:text>Buildd logs</xsl:text>
      </xsl:element>
    </li>
  </xsl:if>
  <!-- DISABLED until ddtp.debian.org is back up
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://ddtp.debian.org/stats/pdesc/report.cgi?package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
          <xsl:text>&amp;lang=all&amp;type=src-drvbin&amp;subword=0</xsl:text>
        </xsl:attribute>
        Description's translations (DDTP)
      </xsl:element>
    </li>
  <xsl:if test="$other/@debconf='yes'">
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://ddtp.debian.org/cgi-bin/ddtp.cgi?part=debconf&amp;package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        Debconf templates's translations (DDTP)
      </xsl:element>
    </li>
  </xsl:if>
  -->
  <xsl:if test="$hasunstable and $other/debcheck/@unstable='yes'">
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://qa.debian.org/debcheck.php?dist=unstable&amp;package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        <xsl:text>Debcheck on unstable</xsl:text>
      </xsl:element>
    </li>
  </xsl:if>
  <xsl:if test="$hastesting and $other/debcheck/@testing='yes'">
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://qa.debian.org/debcheck.php?dist=testing&amp;package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        <xsl:text>Debcheck on testing</xsl:text>
      </xsl:element>
    </li>
  </xsl:if>
  <xsl:if test="$hasstable and $other/debcheck/@stable='yes'">
    <li>
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://qa.debian.org/debcheck.php?dist=stable&amp;package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        <xsl:text>Debcheck on stable</xsl:text>
      </xsl:element>
    </li>
  </xsl:if>
  <!-- convert maintainer/name to follow lintian.debian.org convention [FG] -->
                              <xsl:variable name="pattern" select="concat('àáèéëêòöøîìùñ-/()&#34; ', &quot;'&quot;)"/>
  <xsl:variable name="_name" select="translate(maintainer/name, $pattern, '____________________')"/>
    <li><a href="http://lintian.debian.org/reports/m{$_name}.html#{$package}">Lintian report</a></li>
  
  </td>
  </tr>

  <tr class="titlerow">
  <td class="titlecell" colspan="2">
  <xsl:element name="a">
    <xsl:attribute name="class">
      <xsl:text>titlelink</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="href">
      <xsl:call-template name="mirror"/>
      <xsl:text>/</xsl:text>
      <xsl:value-of select="directory"/>
      <xsl:text>/</xsl:text>
    </xsl:attribute>
    <xsl:text>Source files</xsl:text>
  </xsl:element>
  </td></tr>
  <tr class="normalrow">
  <td class="normalcell" colspan="2" style="text-align: left">
  <xsl:for-each select="files/item">
    <li>
    <xsl:element name="a">
      <xsl:attribute name="class">srcfile</xsl:attribute>
      <xsl:attribute name="href">
        <xsl:call-template name="mirror"/>	  
	<xsl:text>/</xsl:text>
	<xsl:value-of select="../../directory"/>
	<xsl:text>/</xsl:text>
	<xsl:value-of select="filename"/>
      </xsl:attribute>
      <xsl:attribute name="title">
        <xsl:value-of select="size"/>
	<xsl:text> bytes</xsl:text>
      </xsl:attribute>
      <xsl:value-of select="filename"/>
    </xsl:element>
    </li>
  </xsl:for-each>
  </td></tr>
 
  </table>
  <!-- END LEFT SIDE -->
  </td><td class="containercell">
  <!-- RIGHT SIDE -->
  <table class="righttable">


  <!-- Todo list -->
  <xsl:variable name="todo">
    <xsl:if test="@nmu">
      <li>Incorporate and acknowledge the changes from the non maintainer upload.</li>
    </xsl:if>
    <xsl:if test="not(uploaders)and(priority='standard' or priority='required' or priority='important')">
      <li>The package is of priority standard or higher, you should really find some co-maintainers.</li>
    </xsl:if>
    <xsl:if test="not(starts-with(standards-version, $lastsv))">
      <li>The package should be updated to follow the last version of
      <a href="http://www.debian.org/doc/debian-policy/">Debian Policy</a> (Standards-Version 
      <xsl:value-of select="$lastsv"/> instead of 
      <xsl:value-of select="standards-version"/>).</li>
    </xsl:if>
    <xsl:if test="$hasother">
      <xsl:for-each select="$other/todo/item">
        <xsl:call-template name="outputitem"/>
      </xsl:for-each>
      <!-- new upstream version goes in todo [FG] -->
      <xsl:if test="$other/@watch='yes' and $other/watch/@new!='0'"> 
        <li>A new upstream version was found:
           (<xsl:value-of select="$other/watch/@new"/>). <a href="{$other/watch/@url}"><xsl:value-of select="$other/watch/@url"/></a></li>
      </xsl:if>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($todo)>0 and string($todo)!=''">  
  <tr class="titlerow">
  <td class="titlecell" style="background-color: blue">
  Todo
  </td></tr>
  <tr class="normalrow">
  <td class="contentcell2"><xsl:copy-of select="$todo"/>
  </td>
  </tr>
  </xsl:if>
  
  <!-- List of problems -->
  <xsl:variable name="problems">
    <xsl:if test="$hasexcuse and document(concat('../base/', $dir, '/excuse.xml'))/excuse/@problematic">
      <li>The package has not yet entered <a
      href="http://ftp-master.debian.org/testing/update_excuses.html.gz#{$package}">testing</a>
      even though the <xsl:value-of select="document(concat('../base/', $dir, '/excuse.xml'))/excuse/@limit"/>-day
      delay is over.
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:text>http://bjorn.haxx.se/debian/testing.pl?package=</xsl:text>
          <xsl:call-template name="escape-name">
            <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
          </xsl:call-template>
        </xsl:attribute>
        Check why
      </xsl:element>
      .</li>
    </xsl:if>
    <xsl:if test="not(starts-with(standards-version, $lastmajorsv))">
      <li>The package is severly out of date with respect to the Debian
      Policy. Latest version is <xsl:value-of select="$lastsv"/>
      and your package only follows
      <xsl:value-of select="standards-version"/>...</li>
    </xsl:if>
    <xsl:if test="$hasother">
    
      <!-- Override disparity handling. [JvW] -->
      <xsl:if test="$other/@override='yes'">
        <xsl:for-each select="$other/override/group">
          <li>There were override disparities found in suite <xsl:value-of
              select="@suite"/>:
            <ul>
              <xsl:for-each select="disparity">
                <li><xsl:value-of select="text()"/></li>
              </xsl:for-each>
            </ul>
          </li>
        </xsl:for-each>
      </xsl:if>

      <!-- Wnpp handling. [PvR] -->
      <xsl:if test="$other/@wnpp='yes'">
      <li>
	<xsl:choose>
	  <xsl:when test="$other/wnpp/@type='O'">
	  <span style="font-weight: bold">This package has been orphaned</span>. 
	  This means that it does not have a real maintainer at the
	  moment. Please consider adopting this package if you are interested in it.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='ITA'">
	  This package has been orphaned, but someone intends to maintain it.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='RFA'">
	  The current maintainer is looking for someone who can take over
	  maintenance of this package. If you are interested in this package,
	  please consider taking it over. Alternatively you may
	  want to be co-maintainer in order to help the actual maintainer.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='RFH'">
	  The current maintainer is looking for someone who can help with the
	  maintenance of this package. If you are interested in this package,
	  please consider helping out. One way you can help is offer to be a
	  co-maintainer or triage bugs in the bts.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='ITP'">
	  The WNPP database contains an ITP (Intent To Package) entry for
	  this package. This is probably an error, as it has already been
	  packaged.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='RFP'">
	  The WNPP database contains an RFP (Request For Package) entry
	  for this package.  This is probably an error, as it has already
	  been packaged.
	  </xsl:when>
	  <xsl:when test="$other/wnpp/@type='RM'">
	  <span style="font-weight: bold">This package has been requested to be
	  removed</span>. 
	  This means that, when this request gets processed by an ftp-master, this
	  package will no longer be in unstable, and will automatically be removed
	  from testing too afterwards. If for some reason you want keep this
	  package in unstable, please discuss so in the bug.
	  </xsl:when>
	  <xsl:otherwise>
	  The WNPP database contains an entry for this package, 
	  but it is unclear what kind of entry it is. This is probably an error.
	  </xsl:otherwise>
	</xsl:choose>
	<xsl:variable name="bn" select="$other/wnpp/@bugnumber"/>
	Please see bug number <a href="http://bugs.debian.org/{$bn}">
	#<xsl:value-of select="$bn"/></a> for more information.
      </li>
      </xsl:if>
    
    <!-- uscan output if present [FG] -->
    <xsl:if test="$other/@watch='yes'">
      <li>
      <xsl:if test="$other/watch/@warning!=''">
        uscan had problems while searching for a new upstream version: <xsl:value-of select="$other/watch/@warning"/>
      </xsl:if>
      </li>
    </xsl:if>

      <!-- Misc problems reported -->
      <xsl:for-each select="$other/problems/item">
        <xsl:call-template name="outputitem"/>
      </xsl:for-each>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($problems)>0 and string($problems)!=''">
  <tr class="titlerow">
  <td class="titlecell" style="background-color: red">
  Problems
  </td></tr>
  <tr class="normalrow">
  <td class="contentcell2"><xsl:copy-of select="$problems"/>
  </td>
  </tr>
  </xsl:if>

  <xsl:if test="$hasexcuse">
  <tr class="titlerow">
  <td class="titlecell">
  Testing Status
  </td></tr>
  <tr class="normalrow">
  <td class="contentcell2" style="text-align: left">
  <xsl:for-each select="document(concat('../base/', $dir, '/excuse.xml'))/excuse/item">
    <xsl:call-template name="outputitem"/>
  </xsl:for-each>
  </td>
  </tr>
  </xsl:if>

  
  <xsl:variable name="static">
    <xsl:if test="$hasnews">
      <xsl:for-each select="document(concat('../base/', $dir, '/news.xml'))/news/static/item">
	<xsl:call-template name="outputitem"/>
      </xsl:for-each>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($static)>0 and string($static)!=''">
    <tr class="titlerow">
    <td class="titlecell">
    Static Information
    </td></tr>
    <tr class="normalrow">
    <td class="contentcell2"><xsl:copy-of select="$static"/></td>
    </tr>
  </xsl:if>
  
  <xsl:variable name="news">
    <xsl:if test="$hasnews">
      <xsl:for-each select="document(concat('../base/', $dir, '/news.xml'))/news/news/item">
	<xsl:call-template name="outputitem"/>
      </xsl:for-each>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($news)>0 and string($news)!=''">
    <tr class="titlerow">
    <td class="titlecell">
    Latest News
    </td></tr>
    <tr class="normalrow">
    <td class="contentcell2"><xsl:copy-of select="$news"/></td>
    </tr>
  </xsl:if>

  </table>
  <!-- END RIGHT SIDE -->
  </td></tr>
  </table>
  <hr/>
  Debian Package Tracking System - Copyright 2002-2004 Raphaël Hertzog<br/>
  Last modified : <xsl:value-of select="$date"/>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
