[Pkg-haskell-commits] [package-plan] 01/03: test-packages: Pass flag assignment per-package to cabal-install

Joachim Breitner nomeata at moszumanska.debian.org
Wed Sep 10 20:51:59 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 8080ad228694b6cf580495bcc36799b5b600559e
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Sep 10 12:23:10 2014 +0200

    test-packages: Pass flag assignment per-package to cabal-install
---
 test-packages.pl | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test-packages.pl b/test-packages.pl
index 58781b8..ed30910 100755
--- a/test-packages.pl
+++ b/test-packages.pl
@@ -22,7 +22,7 @@ my %binary;
 my %obsolete;
 my %avoid;
 my %ghcpkg;
-my @flags;
+my %flags;
 my %group;
 
 my $allow_upgrade = 0;
@@ -60,7 +60,8 @@ while (<PACKAGES>) {
 	$group{$pkg} = $1 if $attribs =~ s/group=([a-z0-9-]+)\s*//;
 	$binary{$pkg} = $pkg if $attribs =~ s/binary\s*//;
 	$ghcpkg{$pkg}++ if $attribs =~ s/ghcpkg\s*//;
-	push @flags, $1 while $attribs =~ s/(-f[^ ]+)\s*//;
+	$flags{$pkg} = [] unless exists $flags{$pkg};
+	push @{$flags{$pkg}}, $1 while $attribs =~ s/-f([^ ]+)\s*//;
 
 	if ($attribs) {
 		warn "Unknown attributs for $pkg: $attribs\n"
@@ -239,9 +240,6 @@ __END__
 
 unlink "all-packages.cabal";
 
- at flags = uniq(@flags);
-printf "Using flags: %s\n", join " ", @flags;
-
 my %groups;
 $groups{$_}++ foreach values %group;
 $groups{default}++;
@@ -254,7 +252,11 @@ my $all_runs_ok = 1;
 for my $group (@groups) {
 	my @params = ("cabal", "-v", "--config-file", "$sandboxdir/config", "install", "--dry-run", "--force-reinstall","--max-backjumps","-1");
 
-	push @params, @flags;
+	for my $pkg (sort keys %flags) {
+		for my $flag (@{$flags{$pkg}}) {
+			push @params, "--constraint", sprintf "%s %s", $pkg, $flag;
+		}
+	}
 
 	for my $pkg (sort keys %obsolete) {
 		push @params, "--constraint", sprintf "%s (== 42.23.1.2)", $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