[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#686326: PTS: mentors.d.n integration doesn't use suites other than unstable



Package: qa.debian.org
Severity: normal
User: qa.debian.org@packages.debian.org
Usertags: pts

It is possible to upload packages for any Debian suite to
mentors.debian.net and the mentors site will accept them and list the
source packages into the appropriate Sources file for the suite.
Unfortunately the PTS has does not look at suites other than unstable so
if someone uploads a package to experimental or squeeze-backports then
the mentors to-do item will not be shown in the PTS. I have attached a
partial patch for this, but I need help with the XSL parts.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
Index: xsl/pts-issues.xsl
===================================================================
--- xsl/pts-issues.xsl	(revision 2833)
+++ xsl/pts-issues.xsl	(working copy)
@@ -69,7 +69,7 @@
 	<a href="http://mentors.debian.net";><tt>mentors.debian.net</tt></a> has
 	<a href="http://mentors.debian.net/package/{$escaped-package}";>version
 	  <xsl:value-of select="$mentors_version" /></a> of this package, you
-	should consider sponsoring its upload.
+	should consider sponsoring their upload.
       </li>
     </xsl:if>
   </xsl:template>
Index: bin/filter_mentors.pl
===================================================================
--- bin/filter_mentors.pl	(revision 2833)
+++ bin/filter_mentors.pl	(working copy)
@@ -113,14 +113,15 @@
 	print STDERR "$0: warning: mentors packages index appears empty, continuing without\n";
 }
 
-my %unstable;
+my %suite;
+my $dist = $ARGV[0];
 
 foreach my $component ( "main", "contrib", "non-free" )
 {
 	my $package;
 	my $version;
 
-	open INPUT, "<Sources-unstable_$component" or die;
+	open INPUT, "<Sources-$dist\_$component" or next;
 	while(<INPUT>)
 	{
 		chomp;
@@ -130,9 +131,9 @@
 
 		if( /^$/ )
 		{
-			$unstable{$package} = $version
-				if( ! defined $unstable{$package}
-				or Dpkg::Version::version_compare( $unstable{$package}, $version ) < 0 );
+			$suite{$package} = $version
+				if( ! defined $suite{$package}
+				or Dpkg::Version::version_compare( $suite{$package}, $version ) < 0 );
 
 			$package = undef;
 			$version = undef;
@@ -153,11 +154,11 @@
 	return if( defined $seen{$package}{$version} );
 	$seen{$package}{$version} = 1;
 
-	return if( defined $unstable{$package} and $unstable{$package} eq $version );
+	return if( defined $suite{$package} and $suite{$package} eq $version );
 
-	return if( defined $unstable{$package}
+	return if( defined $suite{$package}
 		and $version !~ /~bpo\d+\+\d+$/
-		and Dpkg::Version::version_compare( $unstable{$package}, $version ) > 0 );
+		and Dpkg::Version::version_compare( $suite{$package}, $version ) > 0 );
 
 	return if( ! defined $mentorsneedssponsor{$package} and $keys_mentorsneedssponsor > 0 );
 
@@ -173,8 +174,8 @@
 	my $version;
 	my $block = "";
 
-	open INPUT, "<Sources-mentors_$component" or die;
-	open OUTPUT, ">Sources-mentors_${component}_new" or die;
+	open INPUT, "<Sources-mentors-$dist\_$component" or next;
+	open OUTPUT, ">Sources-mentors-$dist\_${component}_new" or die;
 	while(<INPUT>)
 	{
 		chomp;
Index: bin/update_incoming.sh
===================================================================
--- bin/update_incoming.sh	(revision 2833)
+++ bin/update_incoming.sh	(working copy)
@@ -10,11 +10,17 @@
 security="http://security.debian.org";
 backports="http://backports.debian.org/debian-backports/";
 piuparts="http://piuparts.debian.org";
+mentors="http://mentors.debian.net/debian";
 
 official_distros="oldstable stable testing unstable experimental"
 pu_distros="oldstable-proposed-updates stable-updates stable-proposed-updates testing-proposed-updates"
 security_distros="oldstable stable testing"
 backports_distros="oldstable-backports oldstable-backports-sloppy stable-backports"
+mentors_distros="oldstable stable unstable experimental
+oldstable-backports oldstable-backports-sloppy stable-backports
+oldstable-security stable-security testing-security
+oldstable-proposed-updates stable-proposed-updates testing-proposed-updates 
+UNRELEASED"
 
 umask 002
 set -e
@@ -77,6 +83,12 @@
   $* > "$dest" || (echo "Failure while executing $* . Continuing ..." ; cp "$dest.bak" "$dest")
 }
 
+nice_mv() {
+  if [ -f "$1" ] ; then
+    mv -f "$1" "$2"
+  fi
+}
+
 # Download all Sources.gz
 for comp in main contrib non-free
 do
@@ -92,8 +104,12 @@
       get $backports/dists/$dist/$comp/source/Sources.gz \
 	Sources-${dist}_$comp.gz
     done
-    get http://mentors.debian.net/debian/dists/unstable/$comp/source/Sources.gz \
-        Sources-mentors_$comp.gz
+    for dist in $mentors_distros ; do
+      # Ignore errors since mentors currently only generates Sources files for
+      # suites that some packages use
+      get $mentors/dists/$dist/$comp/source/Sources.gz \
+        Sources-mentors-${dist}_$comp.gz > /dev/null
+    done
 done
 
 # Download update_excuses.html
@@ -193,9 +209,11 @@
 done
 
 # filter out some packages from Sources-mentors_*
-../bin/filter_mentors.pl
-mv Sources-mentors_main_new Sources-mentors_main
-mv Sources-mentors_contrib_new Sources-mentors_contrib
-mv Sources-mentors_non-free_new Sources-mentors_non-free
+for dist in $mentors_distros ; do
+    ../bin/filter_mentors.pl ${dist}
+    nice_mv Sources-mentors-${dist}_main_new Sources-mentors-${dist}_main
+    nice_mv Sources-mentors-${dist}_contrib_new Sources-mentors-${dist}_contrib
+    nice_mv Sources-mentors-${dist}_non-free_new Sources-mentors-${dist}_non-free
+done
 
 # vim: ts=8
Index: bin/generate_html.sh
===================================================================
--- bin/generate_html.sh	(revision 2833)
+++ bin/generate_html.sh	(working copy)
@@ -76,8 +76,12 @@
     fi
     # Create parameters and check if an update is needed
     # XXX order _does_ matter, the latter has precedence over the former
+      mentors-oldstable mentors-stable mentors-unstable mentors-experimental
+      mentors-oldstable-backports mentors-oldstable-backports-sloppy mentors-stable-backports
+      mentors-oldstable-security mentors-stable-security mentors-testing-security
+      mentors-oldstable-proposed-updates mentors-stable-proposed-updates mentors-testing-proposed-updates 
+      mentors-UNRELEASED \
     for i in news excuse other \
-      mentors \
       oldstable-proposed-updates stable-proposed-updates testing-proposed-updates \
       stable-updates stable-backports \
       oldstable oldstable-backports oldstable-backports-sloppy \
Index: bin/sources_to_xml.py
===================================================================
--- bin/sources_to_xml.py	(revision 2833)
+++ bin/sources_to_xml.py	(working copy)
@@ -158,12 +158,13 @@
             if src not in binary_to_sources[pkg][d]:
                 binary_to_sources[pkg][d].append(src)
 
-def treat_sources_file(fname, dist, update_mapping):
+def treat_sources_file(fname, dist, update_mapping, complain=True):
     """Scan the given Sources file and treat each Package entry"""
     try:
         f = open(fname, "r")
     except IOError:
-        sys.stderr.write("Skipping parsing of non-existing/non-readable %s\n" % fname)
+        if complain:
+            sys.stderr.write("Skipping parsing of non-existing/non-readable %s\n" % fname)
         return
     while 1:
         try:
@@ -192,8 +193,13 @@
     'security-oldstable', 'security-stable', 'security-testing',
     'oldstable-backports', 'oldstable-backports-sloppy', 'stable-backports',
     'oldstable-proposed-updates', 'stable-proposed-updates', 'testing-proposed-updates', 
-    'mentors',
 ]
+mentors_other_distros = [
+    'oldstable-backports', 'oldstable-backports-sloppy', 'stable-backports',
+    'oldstable-security', 'stable-security', 'testing-security',
+    'oldstable-proposed-updates', 'stable-proposed-updates', 'testing-proposed-updates',
+    'UNRELEASED',
+]
 
 source_to_binaries = {}
 binary_to_sources = {}
@@ -206,6 +212,16 @@
     for comp in ['main', 'contrib', 'non-free']:
         treat_sources_file(os.path.join(dir, 'Sources-%s_%s' % (distro, comp)),
             distro, False)
+for distro in main_distros:
+    distro = 'mentors-' + distro
+    for comp in ['main', 'contrib', 'non-free']:
+        treat_sources_file(os.path.join(dir, 'Sources-%s_%s' % (distro, comp)),
+            distro, True, False)
+for distro in mentors_other_distros:
+    distro = 'mentors-' + distro
+    for comp in ['main', 'contrib', 'non-free']:
+        treat_sources_file(os.path.join(dir, 'Sources-%s_%s' % (distro, comp)),
+            distro, False, False)
 
 # Store the list of sources generated
 f = open(odir + "/sources_done", "w")

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: