Loading test-packages.pl +75 −81 Original line number Diff line number Diff line Loading @@ -233,12 +233,10 @@ for my $pkg (sort keys %packages) { } my $sandboxdir = cwd() . "/cabal-sandbox"; my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/01-index.tar"; my $tarpath = "$sandboxdir/packages/debian/00-index.tar"; my $dbpath = "$sandboxdir/db"; my $createsandbox = 0; for my $tarnumber ("00", "01") { my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/".$tarnumber."-index.tar"; my $tarpath = "$sandboxdir/packages/debian/".$tarnumber."-index.tar"; if (-e $tarpath) { $createsandbox++ if (-M $originaltarpath < -M $tarpath); $createsandbox++ if (-M "./patches" < -M $tarpath); Loading @@ -251,7 +249,7 @@ for my $tarnumber ("00", "01") { } else { $createsandbox++; } } if ($createsandbox) { print "(Re-)Creating local hackage \"repository\"...\n"; Loading @@ -273,10 +271,7 @@ __END__ close CABALCONFIG or die $!; for my $tarnumber ("00", "01") { my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/".$tarnumber."-index.tar"; my $tarpath = "$sandboxdir/packages/debian/".$tarnumber."-index.tar"; print "Reading ".$tarnumber."-index.tar...\n"; print "Reading 01-index.tar...\n"; my $tar = Archive::Tar->new($originaltarpath); print "Adding additional packages...\n"; for my $cabalfile (<./additional-cabals/*.cabal>) { Loading Loading @@ -318,7 +313,7 @@ __END__ } my $cabalpath = sprintf "%s/%s/%s.cabal", $pkg, $version, $pkg; unless ($tar->contains_file($cabalpath)) { printf "File %s not found in ".$tarnumber."-index.tar\n", $cabalpath; printf "File %s not found in 00-index.tar\n", $cabalpath; $error_count++; next } Loading @@ -341,10 +336,9 @@ __END__ $tarfile->replace_content($content) or die; $stats{patched}++; } print "Writing ".$tarnumber."-index.tar...\n"; print "Writing 00-index.tar...\n"; $tar->write($tarpath); } } print "Creating fake global package db\n"; system("rm","-rf",$dbpath); Loading Loading
test-packages.pl +75 −81 Original line number Diff line number Diff line Loading @@ -233,12 +233,10 @@ for my $pkg (sort keys %packages) { } my $sandboxdir = cwd() . "/cabal-sandbox"; my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/01-index.tar"; my $tarpath = "$sandboxdir/packages/debian/00-index.tar"; my $dbpath = "$sandboxdir/db"; my $createsandbox = 0; for my $tarnumber ("00", "01") { my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/".$tarnumber."-index.tar"; my $tarpath = "$sandboxdir/packages/debian/".$tarnumber."-index.tar"; if (-e $tarpath) { $createsandbox++ if (-M $originaltarpath < -M $tarpath); $createsandbox++ if (-M "./patches" < -M $tarpath); Loading @@ -251,7 +249,7 @@ for my $tarnumber ("00", "01") { } else { $createsandbox++; } } if ($createsandbox) { print "(Re-)Creating local hackage \"repository\"...\n"; Loading @@ -273,10 +271,7 @@ __END__ close CABALCONFIG or die $!; for my $tarnumber ("00", "01") { my $originaltarpath = $ENV{HOME}."/.cabal/packages/hackage.haskell.org/".$tarnumber."-index.tar"; my $tarpath = "$sandboxdir/packages/debian/".$tarnumber."-index.tar"; print "Reading ".$tarnumber."-index.tar...\n"; print "Reading 01-index.tar...\n"; my $tar = Archive::Tar->new($originaltarpath); print "Adding additional packages...\n"; for my $cabalfile (<./additional-cabals/*.cabal>) { Loading Loading @@ -318,7 +313,7 @@ __END__ } my $cabalpath = sprintf "%s/%s/%s.cabal", $pkg, $version, $pkg; unless ($tar->contains_file($cabalpath)) { printf "File %s not found in ".$tarnumber."-index.tar\n", $cabalpath; printf "File %s not found in 00-index.tar\n", $cabalpath; $error_count++; next } Loading @@ -341,10 +336,9 @@ __END__ $tarfile->replace_content($content) or die; $stats{patched}++; } print "Writing ".$tarnumber."-index.tar...\n"; print "Writing 00-index.tar...\n"; $tar->write($tarpath); } } print "Creating fake global package db\n"; system("rm","-rf",$dbpath); Loading