307N/A# Copyright (C) 1997,1998,1999, Roger Espel Llima 3038N/A# Copyright (C) 2000, Sergey Babkin 3038N/A# Copyright (C) 2009, Alex Kozlov 307N/A# Permission is hereby granted, free of charge, to any person obtaining a copy 307N/A# of this software and any associated documentation files (the "Software"), to 307N/A# deal in the Software without restriction, including without limitation the 307N/A# rights to use, copy, modify, merge, publish, distribute, sublicense, 307N/A# and/or sell copies of the Software, and to permit persons to whom the 307N/A# Software is furnished to do so, subject to the following conditions: 307N/A# The above copyright notice and this permission notice shall be included in 307N/A# all copies or substantial portions of the Software. 307N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 307N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 307N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 307N/A# SOFTWARE'S COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 307N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 307N/A# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 307N/A# why does the world need another rpm2cpio? because the existing one 307N/A# won't build unless you have half a ton of things that aren't really 307N/A# required for it, since it uses the same library used to extract RPM's. 307N/A# in particular, it won't build on the HPsUX box i'm on. 3038N/A open($f,
"< $ARGV[0]")
or die "Can't read file $ARGV[0]\n";
3038N/A print "rpm2cpio v1.3, perl version by orabidoo\n";
3038N/A print "use: rpm2cpio [file.rpm]\n";
3038N/A print "dumps the contents to stdout as a GNU cpio archive\n";
3038N/A #printf(STDERR "0x%x 0x%x 0x%x 0x%x 0x%x\n", 3038N/A # tell($f)-16, $magic, $sections, $bytes, $smagic); 3038N/A # assume lzma if there is no sig 3038N/A read $f, $
rpm,
15,
1 or die "No header\n" ;
3038N/Aopen(
ZCAT,
"| $filter")
or die "can't pipe to $filter\n";