home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Caldera Network Desktop 1.0
/
caldera-network-desktop-1.0.bin
/
images
/
ramdisk2.img
/
usr
/
lib
/
perl
/
rpmhead
< prev
next >
Wrap
Text File
|
1995-10-09
|
775b
|
34 lines
sub get_name_file_dict {
local (*dict) = @_;
local (@files, $n);
local ($m1, $m2, $m3, $m4, $major, $minor, $type, $cpu, $name,
$specoff, $speclen, $archiveoffset, $header, $c);
opendir(D, "/image/RedHat/RPMS");
@files = readdir(D);
closedir(D);
&rhs_infobox("Scanning packages",
"\nScanning your hard drive for available packages\n\n",
, 60);
foreach $n (@files) {
open(FD, "</image/RedHat/RPMS/$n");
sysread(FD, $header, 88);
$m1 = 0;
($m1, $m2, $m3, $m4, $major, $minor, $type, $cpu, $name,
$specoff, $speclen, $archiveoffset) =
unpack("CCCC CC n n A66 N N N", $header);
close(FD);
if (($m1, $m2, $m3, $m4) == (0xed, 0xab, 0xee, 0xdb)) {
$dict{"$name.i386.rpm"} = $n;
}
}
return 1;
}
1;