* Fixed a bug where some symlinks where not created because the

directory where they should be created didn't exist yet.
This commit is contained in:
Raphaël Hertzog 2001-03-18 19:01:36 +00:00
parent 94fea67ce5
commit 8d5ca3775b
1 changed files with 23 additions and 9 deletions

View File

@ -38,16 +38,30 @@ while (defined($_ = <LIST>)) {
# .../binary-all/... and we reproduce a similar setup on the CD
if ($arch eq "all" and (-l "$source/$file" or
$file =~ m#/binary-all/#)) {
$file =~ s#/binary-all/#/binary-$ENV{'ARCH'}/#g;
if ($section =~ /non-US/) {
$file =~ m#/([^/]+)$# and $name = $1;
symlink ("../binary-all/$name", "$dir/$file");
} else {
$file =~ m#/([^/]+/[^/]+)$# and $name = $1;
symlink ("../../binary-all/$name", "$dir/$file");
}
$file =~ s#/binary-$ENV{'ARCH'}/#/binary-all/#g;
$file =~ s#/binary-all/#/binary-$ENV{'ARCH'}/#g;
# Check that the directory where the link will be created does
# exist
my $pdir = "$dir/$file";
$pdir =~ s#[^/]+$##g;
if (! -d $pdir)
{
system("mkdir -p $pdir");
}
# Create the symlink from binary-$arch to binary-all
if ($section =~ /non-US/) {
$file =~ m#/([^/]+)$# and $name = $1;
symlink ("../binary-all/$name", "$dir/$file") ||
die "Can't symlink $dir/$file to ../binary-all/$name: $!";
} else {
$file =~ m#/([^/]+/[^/]+)$# and $name = $1;
symlink ("../../binary-all/$name", "$dir/$file") ||
die "Can't symlink $dir/$file to ../../binary-all/$name: $!";
}
$file =~ s#/binary-$ENV{'ARCH'}/#/binary-all/#g;
}
# And we put the file in the CD tree (with a (hard) link)
$realfile = real_file ("$source/$file");
good_link ($realfile, "$dir/$file");