* Populate the `man' subdirectory.
svn path=/nixpkgs/trunk/; revision=70
This commit is contained in:
parent
9878a15478
commit
c43c6511f4
|
@ -5,7 +5,7 @@ use Cwd;
|
||||||
|
|
||||||
my $selfdir = cwd;
|
my $selfdir = cwd;
|
||||||
|
|
||||||
my @dirs = ("bin", "sbin", "lib", "include");
|
my @dirs = ("bin", "sbin", "lib", "include", "man");
|
||||||
|
|
||||||
# Create the subdirectories.
|
# Create the subdirectories.
|
||||||
mkdir $selfdir;
|
mkdir $selfdir;
|
||||||
|
@ -22,25 +22,25 @@ sub createLinks {
|
||||||
my @srcfiles = glob("$srcdir/*");
|
my @srcfiles = glob("$srcdir/*");
|
||||||
|
|
||||||
foreach my $srcfile (@srcfiles) {
|
foreach my $srcfile (@srcfiles) {
|
||||||
my $basename = $srcfile;
|
my $basename = $srcfile;
|
||||||
$basename =~ s/^.*\///g; # strip directory
|
$basename =~ s/^.*\///g; # strip directory
|
||||||
my $dstfile = "$dstdir/$basename";
|
my $dstfile = "$dstdir/$basename";
|
||||||
if (-d $srcfile) {
|
if (-d $srcfile) {
|
||||||
# !!! hack for resolving name clashes
|
# !!! hack for resolving name clashes
|
||||||
if (!-e $dstfile) {
|
if (!-e $dstfile) {
|
||||||
mkdir($dstfile) or
|
mkdir($dstfile) or
|
||||||
die "error creating directory $dstfile";
|
die "error creating directory $dstfile";
|
||||||
}
|
}
|
||||||
-d $dstfile or die "$dstfile is not a directory";
|
-d $dstfile or die "$dstfile is not a directory";
|
||||||
createLinks($srcfile, $dstfile);
|
createLinks($srcfile, $dstfile);
|
||||||
} elsif (-l $dstfile) {
|
} elsif (-l $dstfile) {
|
||||||
my $target = readlink($dstfile);
|
my $target = readlink($dstfile);
|
||||||
die "collission between $srcfile and $target";
|
die "collission between $srcfile and $target";
|
||||||
} else {
|
} else {
|
||||||
print "linking $dstfile to $srcfile\n";
|
print "linking $dstfile to $srcfile\n";
|
||||||
symlink($srcfile, $dstfile) or
|
symlink($srcfile, $dstfile) or
|
||||||
die "error creating link $dstfile";
|
die "error creating link $dstfile";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,6 @@ foreach my $name (keys %ENV) {
|
||||||
print "merging $pkgdir\n";
|
print "merging $pkgdir\n";
|
||||||
|
|
||||||
foreach my $dir (@dirs) {
|
foreach my $dir (@dirs) {
|
||||||
createLinks("$pkgdir/$dir", "$selfdir/$dir");
|
createLinks("$pkgdir/$dir", "$selfdir/$dir");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue