From 5502f298dad51b1c7d627f3e4c99af7879ac2a4b Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 23 Aug 2005 12:47:56 +0000 Subject: If extracting an archive to an undefined directory, output to stdout. (used by urpmq) --- Packdrakeng.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Packdrakeng.pm') 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); -- cgit v1.2.1