summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-11-07 19:15:36 +0000
committerFrancois Pons <fpons@mandriva.com>1999-11-07 19:15:36 +0000
commit83e615434cf1bc3a692ab95b9b8aac3af6c366c8 (patch)
tree1cb6ef2129a09da1d25d0070055540f01bc88c74 /perl-install/commands.pm
parent5fe426f2d1024c2a73791ffdafc2404bfccb8736 (diff)
downloaddrakx-83e615434cf1bc3a692ab95b9b8aac3af6c366c8.tar
drakx-83e615434cf1bc3a692ab95b9b8aac3af6c366c8.tar.gz
drakx-83e615434cf1bc3a692ab95b9b8aac3af6c366c8.tar.bz2
drakx-83e615434cf1bc3a692ab95b9b8aac3af6c366c8.tar.xz
drakx-83e615434cf1bc3a692ab95b9b8aac3af6c366c8.zip
*** empty log message ***
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm56
1 files changed, 0 insertions, 56 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 34653ba74..0323f0f02 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -517,62 +517,6 @@ sub install_cpio($$) {
$cached_failed_install_cpio{"$dir $name"} = 1;
}
-sub catsksz($$$$) {
- my ($input, $seek, $siz, $output) = @_;
- my ($buf, $sz);
-
- while (($sz = sysread($input, $buf, $seek > 4096 ? 4096 : $seek))) {
- $seek -= $sz;
- last unless $seek > 0;
- }
- while (($sz = sysread($input, $buf, $siz > 4096 ? 4096 : $siz))) {
- $siz -= $sz;
- syswrite($output, $buf);
- last unless $siz > 0;
- }
-}
-
-sub extract_from_archive($$$) {
- my ($archive, $dir, $file) = @_;
-
- require 'log.pm';
-
- log::l("data=$archive->{data}");
- unless (-r $archive->{archive}) {
- log::l($_) foreach keys %{$archive};
- log::l("unable to access archive $archive->{archive} from $archive");
- return;
- }
- unless ($archive->{data}) {
- my %data;
-
- log::l("loading archive description file $archive->{data_file}");
- eval `cat $archive->{data_file}`;
- $archive->{data} = { %data };
- }
- my $data_of_file = $archive->{data}{$file};
- unless ($data_of_file) {
- log::l("unable to find file $file in archive $archive->{archive}");
- return;
- }
- unless ($data_of_file->[0] >= 0 && $data_of_file->[1] > 0 &&
- $data_of_file->[2] >= 0 && $data_of_file->[3] > 0) {
- log::l("bad entry of file $file in archive $archive->{archive}");
- return;
- }
-
- local *OUTPUT;
- if (open OUTPUT, "-|") { #- parent create file from child extraction from archive.
- local *FILE; open FILE, ">$dir/$file";
- catsksz(\*OUTPUT, $data_of_file->[2], $data_of_file->[3], \*FILE);
- } else { #- child execute bzip2 -d on its stdout which is OUTPUT.
- local *BUNZIP2; open BUNZIP2, "| bzip2 -d >&STDOUT";
- local *ARCHIVE; open ARCHIVE, "<$archive->{archive}" or exec 'false';
- catsksz(\*ARCHIVE, $data_of_file->[0], $data_of_file->[1], \*BUNZIP2);
- exec 'true';
- }
- 1;
-}
#-######################################################################################
#- Wonderful perl :(