diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2003-05-30 11:49:43 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2003-05-30 11:49:43 +0000 |
commit | c43c6511f48991a9036ddc3fc5a809f7d20b66b0 (patch) | |
tree | bdf8f9a3da6cfb41e61796408d8821ae599472b6 | |
parent | 9878a154789dd5b2774508ea553bbf51253f6206 (diff) |
* Populate the `man' subdirectory.
svn path=/nixpkgs/trunk/; revision=70
-rwxr-xr-x | build/populate-linkdirs.pl | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/build/populate-linkdirs.pl b/build/populate-linkdirs.pl index d375caa7d3d0f..c632a9ca31d94 100755 --- a/build/populate-linkdirs.pl +++ b/build/populate-linkdirs.pl @@ -5,7 +5,7 @@ use Cwd; my $selfdir = cwd; -my @dirs = ("bin", "sbin", "lib", "include"); +my @dirs = ("bin", "sbin", "lib", "include", "man"); # Create the subdirectories. mkdir $selfdir; @@ -22,25 +22,25 @@ sub createLinks { my @srcfiles = glob("$srcdir/*"); foreach my $srcfile (@srcfiles) { - my $basename = $srcfile; - $basename =~ s/^.*\///g; # strip directory - my $dstfile = "$dstdir/$basename"; - if (-d $srcfile) { - # !!! hack for resolving name clashes - if (!-e $dstfile) { - mkdir($dstfile) or - die "error creating directory $dstfile"; - } - -d $dstfile or die "$dstfile is not a directory"; - createLinks($srcfile, $dstfile); - } elsif (-l $dstfile) { - my $target = readlink($dstfile); - die "collission between $srcfile and $target"; - } else { - print "linking $dstfile to $srcfile\n"; - symlink($srcfile, $dstfile) or - die "error creating link $dstfile"; - } + my $basename = $srcfile; + $basename =~ s/^.*\///g; # strip directory + my $dstfile = "$dstdir/$basename"; + if (-d $srcfile) { + # !!! hack for resolving name clashes + if (!-e $dstfile) { + mkdir($dstfile) or + die "error creating directory $dstfile"; + } + -d $dstfile or die "$dstfile is not a directory"; + createLinks($srcfile, $dstfile); + } elsif (-l $dstfile) { + my $target = readlink($dstfile); + die "collission between $srcfile and $target"; + } else { + print "linking $dstfile to $srcfile\n"; + symlink($srcfile, $dstfile) or + die "error creating link $dstfile"; + } } } @@ -53,6 +53,6 @@ foreach my $name (keys %ENV) { print "merging $pkgdir\n"; foreach my $dir (@dirs) { - createLinks("$pkgdir/$dir", "$selfdir/$dir"); + createLinks("$pkgdir/$dir", "$selfdir/$dir"); } } |