diff options
author | nox <nox@FreeBSD.org> | 2010-08-22 23:29:21 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2010-08-22 23:29:21 +0800 |
commit | cd5b70120184315b2fdf1e6641479d695150fde1 (patch) | |
tree | 71050ad40c0f460d67703161355eb7dfd5ae9e7e /archivers | |
parent | 2a79a0945416cb149b9141aaf9f4e37f14190aa1 (diff) | |
download | freebsd-ports-graphics-cd5b70120184315b2fdf1e6641479d695150fde1.tar.gz freebsd-ports-graphics-cd5b70120184315b2fdf1e6641479d695150fde1.tar.zst freebsd-ports-graphics-cd5b70120184315b2fdf1e6641479d695150fde1.zip |
Some minor updates:
- remove $/, $| it's artifacts from $rpm = <$f>; time.
[this might help in low RAM situations]
- change && to and
- whitespace cosmetic.
Submitted by: Alex Kozlov <spam@rm-rf.kiev.ua> (via private email)
Diffstat (limited to 'archivers')
-rw-r--r-- | archivers/rpm2cpio/Makefile | 1 | ||||
-rw-r--r-- | archivers/rpm2cpio/files/rpm2cpio | 10 |
2 files changed, 4 insertions, 7 deletions
diff --git a/archivers/rpm2cpio/Makefile b/archivers/rpm2cpio/Makefile index 00b1c6e8708..ba5913b6252 100644 --- a/archivers/rpm2cpio/Makefile +++ b/archivers/rpm2cpio/Makefile @@ -7,6 +7,7 @@ PORTNAME= rpm2cpio PORTVERSION= 1.3 +PORTREVISION= 1 CATEGORIES= archivers MASTER_SITES= # none DISTFILES= # none diff --git a/archivers/rpm2cpio/files/rpm2cpio b/archivers/rpm2cpio/files/rpm2cpio index 24a4c15795f..8f75375af53 100644 --- a/archivers/rpm2cpio/files/rpm2cpio +++ b/archivers/rpm2cpio/files/rpm2cpio @@ -44,16 +44,12 @@ if ($#ARGV == -1) { exit 0; } -# gobble the file up -undef $/; -$|=1; - read $f, $rpm, 96; my ($magic, $major, undef) = unpack("NCC", $rpm); die "Not an RPM\n" if $magic != 0xedabeedb; -die "Not a version 3 or 4 RPM\n" if $major != 3 && $major != 4; +die "Not a version 3 or 4 RPM\n" if $major != 3 and $major != 4; read $f, $rpm, 16 or die "No header\n"; while(1) { @@ -73,7 +69,7 @@ while(1) { last; } # 0xFD, '7zXZ', 0x0 - if ($smagic == 0xfd37 and $smagic2== 0x7a585a00) { + if ($smagic == 0xfd37 and $smagic2 == 0x7a585a00) { $filter = "xz -cd"; last; } @@ -84,7 +80,7 @@ while(1) { } # skip the headers - seek $f, 16*$sections+$bytes, 1 or die "File is too small\n"; + seek $f, 16 * $sections + $bytes, 1 or die "File is too small\n"; do { read $f, $rpm, 1 or die "No header\n" ; } while(0 == unpack("C", $rpm)); |