[Pkg-haskell-commits] [package-plan] 01/02: Add group support to handle Cabal
Joachim Breitner
nomeata at moszumanska.debian.org
Sun Jun 8 11:47:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
nomeata pushed a commit to branch multiple-groups
in repository package-plan.
commit 8188703a05c04546decb2c277226c2b6a88d9f0f
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sun Jun 8 13:00:45 2014 +0200
Add group support to handle Cabal
---
packages.txt | 3 ++-
test-packages.pl | 76 ++++++++++++++++++++++++++++++++++++++++----------------
2 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/packages.txt b/packages.txt
index 6210b24..c1dc468 100644
--- a/packages.txt
+++ b/packages.txt
@@ -1,4 +1,5 @@
acid-state 0.12.2
+Cabal 1.20.0.1 group=new-cabal
active 0.1.0.16
adjunctions 4.0.3
aeson 0.7.0.3
@@ -63,7 +64,7 @@ bzlib 0.5.0.4
c2hs 0.17.1 binary notest
cabal-debian 3.9 binary
cabal-file-th 0.2.3
-cabal-install 1.16.0.2 binary
+cabal-install 1.20.0.2 binary group=new-cabal
cairo 0.12.5.3
carettah 0.3.0 binary
case-insensitive 1.1.0.2
diff --git a/test-packages.pl b/test-packages.pl
index d0478a9..cf41d73 100755
--- a/test-packages.pl
+++ b/test-packages.pl
@@ -21,6 +21,7 @@ my %notest;
my %binary;
my %obsolete;
my @flags;
+my %group;
my $allow_upgrade = 0;
my $error_count = 0;
@@ -49,6 +50,7 @@ while (<PACKAGES>) {
next unless $comment;
$notest{$pkg}++ if $comment =~ s/notest\s*//;
$binary{$pkg} = $1 if $comment =~ s/binary=([a-z0-9-]+)\s*//;
+ $group{$pkg} = $1 if $comment =~ s/group=([a-z0-9-]+)\s*//;
$binary{$pkg} = $pkg if $comment =~ s/binary\s*//;
push @flags, $1 while $comment =~ s/(-f[^ ]+)\s*//;
$comments{$pkg} = $comment if $comment;
@@ -227,29 +229,65 @@ for my $pkg (sort keys %versions) {
close CABAL;
chmod 0444, "all-packages.cabal";
-my @params = ("cabal", "-v", "--config-file", "$sandboxdir/config", "install", "--dry-run", "--force-reinstall", "--enable-tests");
-
@flags = uniq(@flags);
-push @params, @flags;
printf "Using flags: %s\n", join " ", @flags;
-for my $pkg (sort keys %versions) {
- next if (exists $comments{$pkg});
- push @params, "--constraint", sprintf "%s (%s %s)", $pkg, ($allow_upgrade?">=":"==") ,$versions{$pkg};
-}
-for my $pkg (sort keys %versions) {
- next if (exists $comments{$pkg});
- next if (exists $notest{$pkg});
- push @params, sprintf "%s", $pkg;
+my %groups;
+$groups{$_}++ foreach values %group;
+$groups{default}++;
+my @groups = keys %groups;
+printf "Testing packages in %d different groups\n", (scalar @groups);
+
+my $total_out;
+my $all_runs_ok = 1;
+
+for my $group (@groups) {
+ my @params = ("cabal", "-v", "--config-file", "$sandboxdir/config", "install", "--dry-run", "--force-reinstall", "--enable-tests");
+
+ push @params, @flags;
+
+ for my $pkg (sort keys %versions) {
+ next if (exists $comments{$pkg});
+ # For the default group, add all constraints (things might get pulled in)
+ # For other groups, add all constraints from default and the same group
+ next if (defined $group{$pkg} and $group{$pkg} ne $group);
+ push @params, "--constraint", sprintf "%s (%s %s)", $pkg, ($allow_upgrade?">=":"==") ,$versions{$pkg};
+ }
+ for my $pkg (sort keys %versions) {
+ next if (exists $comments{$pkg});
+ next if (exists $notest{$pkg});
+ next if (($group{$pkg} || 'default') ne $group);
+ push @params, sprintf "%s", $pkg;
+ }
+
+ printf "Running cabal-install (group %s)...\n", $group;
+
+ my $out;
+ my $err;
+ if (run \@params, \"", \$out, \$err) {
+ $total_out .= $out;
+ } else {
+ print "Cabal install failed:\n";
+ $error_count++;
+ $all_runs_ok = 0;
+ print $err;
+ }
}
-print "Running cabal-install...\n";
-my $out;
-my $err;
-if (run \@params, \"", \$out, \$err) {
+my %results;
+
+if ($all_runs_ok) {
my $count=0;
- while ($out =~ m!^([a-zA-Z0-9-]+)-([0-9.]+)(?: \*test)?(?: \(new package\))?$!gm) {
+ while ($total_out =~ m!^([a-zA-Z0-9-]+)-([0-9.]+)(?: \*test)?(?: \(new package\))?$!gm) {
my ($pkg, $version) = ($1, $2);
+ if (exists $results{$pkg} and $results{$pkg} ne $version) {
+ printf "ERROR: Different groups yield different results for %s: %s vs. %s\n", $pkg, $version, $results{$pkg};
+ } else {
+ $results{$pkg} = $version;
+ }
+ }
+
+ while ( my ($pkg, $version) = each %results ) {
unless (exists $versions{$pkg}) {
printf "ERROR: Additional dependency pulled in: %s-%s\n", $pkg, $version;
$error_count++;
@@ -270,12 +308,8 @@ if (run \@params, \"", \$out, \$err) {
printf "%s packages successfully tested for co-installability.\n", $count;
$stats{total} = $count;
unless ($count) {
- printf "Really no packages? output was:\n$out";
+ printf "Really no packages? output was:\n$total_out";
}
-} else {
- print "Cabal install failed:\n";
- $error_count++;
- print $err;
}
open STATS, ">", "stats.csv" or die $!;
--
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