X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=boot-pkgs;h=de3008cf92882db7731ae608a47877952b6c8ae5;hp=677ae52a8c2e30a37c2d528698c126b6523af88f;hb=4c1f0681d85da48deaf706c0f05d971deb48261f;hpb=91987342587901e57f67b375dc9f9aa8e889f241 diff --git a/boot-pkgs b/boot-pkgs index 677ae52..de3008c 100644 --- a/boot-pkgs +++ b/boot-pkgs @@ -25,7 +25,13 @@ for $tarball (@tarballs) { if (-d "libraries/$package/_darcs") { print "Ignoring libraries/$package as it looks like a darcs checkout\n" } + elsif (-d "libraries/$package/.git") { + print "Ignoring libraries/$package as it looks like a git checkout\n" + } else { + if (! -d "libraries/stamp") { + mkdir "libraries/stamp"; + } $stamp = "libraries/stamp/$package"; if ((! -d "libraries/$package") || (! -f "$stamp") || ((-M "libraries/stamp/$package") > (-M $tarball))) { @@ -54,6 +60,7 @@ for $package (glob "libraries/*/") { or die "Failed to open $pkgs: $!"; while () { chomp; + s/\r//g; if (/.+/) { push @library_dirs, "$package/$_"; } @@ -73,31 +80,22 @@ for $package (@library_dirs) { if ($#cabals eq 0) { my $cabal = $cabals[0]; my $pkg; - my $stage; my $top; if (-f $cabal) { $pkg = $cabal; $pkg =~ s#.*/##; $pkg =~ s/\.cabal$//; - if (-f "$package/ghc-stage") { - open STAGE, "< $package/ghc-stage" - or die "Can't open $package/ghc-stage: $!"; - $stage = int(); - close STAGE - or die "Failed closing $package/ghc-stage: $!"; - } - else { - $stage = 1; - } $top = $package; $top =~ s#[^/]+#..#g; + $dir = $package; + $dir =~ s#^libraries/##g; print "Creating $package/ghc.mk\n"; open GHCMK, "> $package/ghc.mk" or die "Opening $package/ghc.mk failed: $!"; print GHCMK "${package}_PACKAGE = ${pkg}\n"; print GHCMK "${package}_dist-install_GROUP = libraries\n"; - print GHCMK "\$(eval \$(call build-package,${package},dist-install,${stage}))\n"; + print GHCMK "\$(eval \$(call build-package,${package},dist-install,\$(if \$(filter ${dir},\$(STAGE2_PACKAGES)),2,1)))\n"; close GHCMK or die "Closing $package/ghc.mk failed: $!";