* Automatically add propagated build inputs to user environments.

Maybe this is a bad idea.
This commit is contained in:
Eelco Dolstra 2005-03-07 13:27:56 +00:00
parent 9a7f95882c
commit 543d7a41dc

View file

@ -25,6 +25,7 @@ sub createLinks {
if ($srcFile =~ /\/propagated-build-inputs$/ || if ($srcFile =~ /\/propagated-build-inputs$/ ||
$srcFile =~ /\/nix-support$/ || $srcFile =~ /\/nix-support$/ ||
$srcFile =~ /\/perllocal.pod$/ ||
$srcFile =~ /\/log$/) $srcFile =~ /\/log$/)
{ {
# Do nothing. # Do nothing.
@ -72,13 +73,27 @@ sub createLinks {
my %done; my %done;
sub addPkg;
sub addPkg { sub addPkg {
my $pkgDir = shift; my $pkgDir = shift;
return if (defined $done{$pkgDir}); return if (defined $done{$pkgDir});
$done{$pkgDir} = 1; $done{$pkgDir} = 1;
print "adding $pkgDir\n";
createLinks("$pkgDir", "$out"); createLinks("$pkgDir", "$out");
my $propagatedFN = "$pkgDir/nix-support/propagated-build-inputs";
if (-e $propagatedFN) {
open PROP, "<$propagatedFN" or die;
my $propagated = <PROP>;
close PROP;
my @propagated = split ' ', $propagated;
foreach my $p (@propagated) {
addPkg $p;
}
}
} }
@ -86,7 +101,6 @@ my @args = split ' ', $ENV{"derivations"};
while (scalar @args > 0) { while (scalar @args > 0) {
my $drvPath = shift @args; my $drvPath = shift @args;
print "adding $drvPath\n";
addPkg($drvPath); addPkg($drvPath);
} }