* [PATCH 0/1] scripts/rpm2cpio.sh fix
@ 2011-12-30 1:29 tom.zanussi
2011-12-30 1:29 ` [PATCH 1/1] rpm2cpio.sh: make compression tests case-insensitive tom.zanussi
2012-01-04 0:03 ` [PATCH 0/1] scripts/rpm2cpio.sh fix Saul Wold
0 siblings, 2 replies; 3+ messages in thread
From: tom.zanussi @ 2011-12-30 1:29 UTC (permalink / raw)
To: openembedded-core
From: Tom Zanussi <tom.zanussi@intel.com>
When running rpm2cpio.sh on an xz-compressed rpm, it failed with the error:
tmp/sysroots/x86_64-linux/usr/bin/unlzma: (stdin): File format not recognized
This is due to the script demanding lowercase in tests that might produce
uppercase output, such as newer versions of 'file'.
Tom Zanussi (1):
rpm2cpio.sh: make compression tests case-insensitive
scripts/rpm2cpio.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] rpm2cpio.sh: make compression tests case-insensitive
2011-12-30 1:29 [PATCH 0/1] scripts/rpm2cpio.sh fix tom.zanussi
@ 2011-12-30 1:29 ` tom.zanussi
2012-01-04 0:03 ` [PATCH 0/1] scripts/rpm2cpio.sh fix Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: tom.zanussi @ 2011-12-30 1:29 UTC (permalink / raw)
To: openembedded-core
From: Tom Zanussi <tom.zanussi@intel.com>
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.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/rpm2cpio.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh
index 426fd77..5df8c0f 100755
--- a/scripts/rpm2cpio.sh
+++ b/scripts/rpm2cpio.sh
@@ -27,13 +27,13 @@ o=`expr $o + $hdrsize`
EXTRACTOR="dd if=$pkg ibs=$o skip=1"
COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null`
-if echo $COMPRESSION |grep -q gzip; then
+if echo $COMPRESSION |grep -iq gzip; then
DECOMPRESSOR=gunzip
-elif echo $COMPRESSION |grep -q bzip2; then
+elif echo $COMPRESSION |grep -iq bzip2; then
DECOMPRESSOR=bunzip2
-elif echo $COMPRESSION |grep -q xz; then
+elif echo $COMPRESSION |grep -iq xz; then
DECOMPRESSOR=unxz
-elif echo $COMPRESSION |grep -q cpio; then
+elif echo $COMPRESSION |grep -iq cpio; then
DECOMPRESSOR=cat
else
# Most versions of file don't support LZMA, therefore we assume
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] scripts/rpm2cpio.sh fix
2011-12-30 1:29 [PATCH 0/1] scripts/rpm2cpio.sh fix tom.zanussi
2011-12-30 1:29 ` [PATCH 1/1] rpm2cpio.sh: make compression tests case-insensitive tom.zanussi
@ 2012-01-04 0:03 ` Saul Wold
1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2012-01-04 0:03 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 12/29/2011 05:29 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi<tom.zanussi@intel.com>
>
> When running rpm2cpio.sh on an xz-compressed rpm, it failed with the error:
>
> tmp/sysroots/x86_64-linux/usr/bin/unlzma: (stdin): File format not recognized
>
> This is due to the script demanding lowercase in tests that might produce
> uppercase output, such as newer versions of 'file'.
>
> Tom Zanussi (1):
> rpm2cpio.sh: make compression tests case-insensitive
>
> scripts/rpm2cpio.sh | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Merged to OE-Core
Thanks
Sau!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-04 0:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30 1:29 [PATCH 0/1] scripts/rpm2cpio.sh fix tom.zanussi
2011-12-30 1:29 ` [PATCH 1/1] rpm2cpio.sh: make compression tests case-insensitive tom.zanussi
2012-01-04 0:03 ` [PATCH 0/1] scripts/rpm2cpio.sh fix Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox