Added an optional parameter ($flat) to InstallFromManifest, to force any relative-path hierarchy in the manifest file to be flattened in the dest dir.

This commit is contained in:
mcmullen%netscape.com 1999-06-02 02:05:36 +00:00
parent 55ee208dfb
commit f71c42994d

View File

@ -335,9 +335,11 @@ C<InstallFromManifest()>
=cut
sub InstallFromManifest($;$)
sub InstallFromManifest($;$$)
{
my ($manifest_file, $dest_dir) = @_;
my ($manifest_file, $dest_dir, $flat) = @_;
$flat = 0 unless defined($flat); # if $flat, all rel. paths in MANIFEST get aliased to the root of $dest_dir
$dest_dir ||= ":";
@ -348,7 +350,14 @@ sub InstallFromManifest($;$)
#Mac::Events->import();
WaitNextEvent();
print "Doing manifest on \"$manifest_file\"\n" unless $QUIET;
if ($flat)
{
print "Doing manifest on \"$manifest_file\" FLAT\n" unless $QUIET;
}
else
{
print "Doing manifest on \"$manifest_file\"\n" unless $QUIET;
}
my $read = maniread(full_path_to($manifest_file));
foreach $file (keys %$read)
@ -356,7 +365,7 @@ sub InstallFromManifest($;$)
next unless $file;
$subdir = ":";
if ( $file =~ /:.+:/ )
if (!$flat && ($file =~ /:.+:/ ))
{
$subdir = $&;
}