RPM-Payload
view release on metacpan or search on metacpan
lib/RPM/Payload.pm view on Meta::CPAN
5678910111213141516171819202122232425our
$VERSION
=
'0.11'
;
sub
new {
my
(
$class
,
$f
) =
@_
;
open
my
$fh
,
"-|"
,
"rpm2cpio"
,
$f
or
die
"$f: rpm2cpio failed"
;
# n1: current data pos
# n2: end data pos
# n3: next entry pos
bless
[
$f
,
$fh
, 0, 0, 0 ] =>
$class
;
}
sub
_skip ($$$) {
my
(
$f
,
$fh
,
$n
) =
@_
;
while
(
$n
> 0) {
my
$m
= (
$n
> 8192) ? 8192 :
$n
;
$m
==
read
$fh
,
my
$buf
,
$m
or
die
"$f: cannot skip cpio bytes"
;
$n
-=
$m
;
}
( run in 0.293 second using v1.01-cache-2.11-cpan-94b05bcf43c )