diff options
-rw-r--r-- | Packdrakeng.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Packdrakeng.pm b/Packdrakeng.pm index f3bd344..6a7e616 100644 --- a/Packdrakeng.pm +++ b/Packdrakeng.pm @@ -602,10 +602,15 @@ sub extract { next; # Don't overwrite a file because where the symlink point to }; } - sysopen(my $destfh, $dest, O_CREAT | O_TRUNC | O_WRONLY) or do { - $pack->{log}("Unable to extract $dest"); - next; - }; + my $destfh; + if (defined $destdir) { + sysopen($destfh, $dest, O_CREAT | O_TRUNC | O_WRONLY) or do { + $pack->{log}("Unable to extract $dest"); + next; + }; + } else { + $destfh = \*STDOUT; + } my $written = $pack->extract_virtual($destfh, $f); $written == -1 and $pack->{log}("Unable to extract file $f"); close($destfh); |