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

Bug#495482: Minor Debcheck patch: Availability state



Package: qa.debian.org
Severity: normal
Tags: patch
User: qa.debian.org@packages.debian.org
Usertags: debcheck

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/
--- Begin Message ---
Hi weasel, hi debian-qa,

I’m looking around the various qa scripts and did a mini patch to get
used to the tools.

This patch strips changes the output from

Package has a Depends on ghc6 (<< 6.6+) which cannot be satisfied on
mips. ghc6 (<< 6.6+) 6.8.2-5 is available.

to 

Package has a Depends on ghc6 (<< 6.6+) which cannot be satisfied on
mips. ghc6 6.8.2-5 is available.

i.e. it prints the package name, no the whole dependency string in the
"is available" part.

Please consider applying it to the qa repository.

Thanks and greetings from Mar del Plata,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata
Index: debcheck
===================================================================
--- debcheck	(Revision 1924)
+++ debcheck	(Arbeitskopie)
@@ -569,6 +569,18 @@
 ###########################################################################
 ################### OUTPUT ################################################
 ###########################################################################
+
+# This helper function takes a partdependency (e.g. "hello (= 1.10)") and
+# returns just the package name.
+sub extract_package_name($) {
+  my ($partdependency) = @_;
+  if ($partdependency =~ /^\s*([a-zA-Z0-9.+_-]+)\s*(?:\((.*)\))?\s*(?:\[\s*(.*?)\s*\])?$/x) {
+		return $1;
+	} else {
+		return "parse error";
+	}
+}
+
 sub builddepends($$$$$) {
 	my ($pkg, $prob, $maint, $section, $Rarchs) = @_;
   print FILE "<h1>BuildDepends</h1><p>";
@@ -578,7 +590,7 @@
 			for my $arch (keys %{$prob->{$dependency}->{$partdependency}}) {
 				print FILE "Package declares a build time dependency on $dependency which cannot be satisfied on $arch.";
 				if ($prob->{$dependency}->{$partdependency}->{$arch} ne '') {
-					print FILE " $partdependency ".$prob->{$dependency}->{$partdependency}->{$arch}." is available.";
+					print FILE " ".extract_package_name($partdependency)." ".$prob->{$dependency}->{$partdependency}->{$arch}." is available.";
 				};
 				my $exists = exists $Rarchs->{$arch}->{'packages'}->{$pkg};
 				unless ($exists) {
@@ -602,7 +614,7 @@
 			for my $arch (keys %{$prob->{$dependency}->{$partdependency}}) {
 				print FILE "Package declares a build time dependency on $partdependency which cannot be satisfied on $arch.";
 				if ($prob->{$dependency}->{$partdependency}->{$arch} ne '') {
-					print FILE " $partdependency ".$prob->{$dependency}->{$partdependency}->{$arch}." is available.";
+					print FILE " ".extract_package_name($partdependency)." ".$prob->{$dependency}->{$partdependency}->{$arch}." is available.";
 				};
 				print FILE " At least one of $dependency can be satisfied however.<br>\n";
 				$broken_archs{$arch}=1;
@@ -740,7 +752,7 @@
 				for my $arch (keys %{$prob->{$depType}->{$depTarget}->{$partdepTarget}}) {
 					print FILE "Package has a $depType on $depTarget which cannot be satisfied on $arch.";
 					if ($prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch} ne '') {
-						print FILE " $partdepTarget ".$prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch}." is available.";
+					  print FILE " ".extract_package_name($partdepTarget)." ".$prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch}." is available.";
 					};
 					print FILE "<br>\n";
 					$broken_archs{$arch}=1;
@@ -763,7 +775,7 @@
 				for my $arch (keys %{$prob->{$depType}->{$depTarget}->{$partdepTarget}}) {
 					print FILE "Package has a $depType on $partdepTarget which cannot be satisfied on $arch.";
 					if ($prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch} ne '') {
-						print FILE " $partdepTarget ".$prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch}." is available.";
+					  print FILE " ".extract_package_name($partdepTarget)." ".$prob->{$depType}->{$depTarget}->{$partdepTarget}->{$arch}." is available.";
 					};
 					print FILE " At least one of $depTarget can be satisfied however.<br>\n";
 					$broken_archs{$arch}=1;

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


--- End Message ---

Attachment: signature.asc
Description: Digital signature


Reply to: