[Pkg-haskell-commits] [package-plan] 01/02: Support "avoid" attribute

Joachim Breitner nomeata at moszumanska.debian.org
Mon Sep 8 12:42:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to branch master
in repository package-plan.

commit 573360d0af9e6497d8c8f7bba5e7345b4f88d8a1
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Sep 8 14:17:45 2014 +0200

    Support "avoid" attribute
---
 README.md        |  3 +++
 test-packages.pl | 13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 314fb21..ba796ce 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,9 @@ The following flags are supported:
  * obsolete:
    Indicates that this package should ''not'' be used, but that it is still in
    the archive. Used until the FTP team acts upon a RM request.
+ * avoid
+   Indicates that this package should ''not'' be used. Used for optional
+   dependencies where we want to force the other alternative.
 
 The tools will warn about unknown flags.
 
diff --git a/test-packages.pl b/test-packages.pl
index 0e63544..58781b8 100755
--- a/test-packages.pl
+++ b/test-packages.pl
@@ -20,6 +20,7 @@ my %ignored;
 my %notest;
 my %binary;
 my %obsolete;
+my %avoid;
 my %ghcpkg;
 my @flags;
 my %group;
@@ -47,6 +48,10 @@ while (<PACKAGES>) {
 		$obsolete{$pkg}++;
 		next;
 	}
+	if ($attribs and $attribs =~ s/avoid\s*//) {
+		$avoid{$pkg}++;
+		next;
+	}
 	$versions{$pkg} = $version;
 	next unless $attribs;
 	$ignored{$pkg}++ if $attribs =~ s/ignored?\s*//;
@@ -105,6 +110,8 @@ for my $pkg (sort keys %packages) {
 			$pkg;
 		$error_count++;
 		$stats{REMOVED}++;
+	} elsif ($avoid{$pkg}) {
+		# do nothing
 	} elsif (! exists($versions{$pkg})) {
 		printf "MISSING:  %s %s\n" ,
 			$pkg, $available{$pkg};
@@ -123,7 +130,7 @@ for my $pkg (sort keys %packages) {
 		printf "Updated:  %s is %s in the archive but %s exists here.\n" ,
 			$pkg, $available{$pkg}, $versions{$pkg};
 		$stats{Updated}++;
- 	}
+	}
 }
 
 my $sandboxdir = cwd() . "/cabal-sandbox";
@@ -252,6 +259,9 @@ for my $group (@groups) {
 	for my $pkg (sort keys %obsolete) {
 		push @params, "--constraint", sprintf "%s (== 42.23.1.2)", $pkg;
 	}
+	for my $pkg (sort keys %avoid) {
+		push @params, "--constraint", sprintf "%s (== 42.23.1.2)", $pkg;
+	}
 
 	for my $pkg (sort keys %versions) {
 		next if (exists $ignored{$pkg});
@@ -273,6 +283,7 @@ for my $group (@groups) {
 	for my $pkg (sort keys %versions) {
 		next if (exists $ignored{$pkg});
 		next if (exists $obsolete{$pkg});
+		next if (exists $avoid{$pkg});
 		next if (($group{$pkg} || 'default') ne $group);
 		push @params, sprintf "%s", $pkg;
 		unless (exists $notest{$pkg}) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/package-plan.git



More information about the Pkg-haskell-commits mailing list