diff options
author | Tom Zanussi <tom.zanussi@intel.com> | 2011-12-29 19:29:06 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-03 12:14:39 +0000 |
commit | fa03a6d17d63db0e69e12c6451075ceab723bbf7 (patch) | |
tree | f0b7cb3c083be9f52599f922b40a4e7c2a8bfe18 | |
parent | 9c6601a45e94d2fa831966901939293515c87a25 (diff) | |
download | poky-fa03a6d17d63db0e69e12c6451075ceab723bbf7.tar.gz |
rpm2cpio.sh: make compression tests case-insensitive
In the rpm2cpio.sh script, the output of $COMPRESSION is tested for
certain lowercase strings such as 'xz' in order to determine the
decompression to use. The problem is that the output strings tested
are from the output of 'file', which uses different cases in different
versions e.g. file-5.09 prints:
tmp/sysroots/x86_64-linux/usr/bin$ ./file xxx.tar.xz: XZ compressed data
while file-5.03 prints:
tmp/sysroots/x86_64-linux/usr/bin$ ./file xxx.tar.xz: xz compressed data
In the former, the XZ string causes xz compressed payloads to
incorrectly fall through to the catch-all lzma case.
(From OE-Core rev: fe48e55988a2208bb7a3a2cc2bc641c41dbd1cb0)
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/rpm2cpio.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh index 426fd77bb7..5df8c0f705 100755 --- a/scripts/rpm2cpio.sh +++ b/scripts/rpm2cpio.sh | |||
@@ -27,13 +27,13 @@ o=`expr $o + $hdrsize` | |||
27 | EXTRACTOR="dd if=$pkg ibs=$o skip=1" | 27 | EXTRACTOR="dd if=$pkg ibs=$o skip=1" |
28 | 28 | ||
29 | COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null` | 29 | COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null` |
30 | if echo $COMPRESSION |grep -q gzip; then | 30 | if echo $COMPRESSION |grep -iq gzip; then |
31 | DECOMPRESSOR=gunzip | 31 | DECOMPRESSOR=gunzip |
32 | elif echo $COMPRESSION |grep -q bzip2; then | 32 | elif echo $COMPRESSION |grep -iq bzip2; then |
33 | DECOMPRESSOR=bunzip2 | 33 | DECOMPRESSOR=bunzip2 |
34 | elif echo $COMPRESSION |grep -q xz; then | 34 | elif echo $COMPRESSION |grep -iq xz; then |
35 | DECOMPRESSOR=unxz | 35 | DECOMPRESSOR=unxz |
36 | elif echo $COMPRESSION |grep -q cpio; then | 36 | elif echo $COMPRESSION |grep -iq cpio; then |
37 | DECOMPRESSOR=cat | 37 | DECOMPRESSOR=cat |
38 | else | 38 | else |
39 | # Most versions of file don't support LZMA, therefore we assume | 39 | # Most versions of file don't support LZMA, therefore we assume |