<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4915</bug_id>
          
          <creation_ts>2013-07-25 13:20:37 +0000</creation_ts>
          <short_desc>poky/scripts/rpm2cpio.sh breaks when file utility missing</short_desc>
          <delta_ts>2017-07-20 15:18:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>configuration</component>
          <version>1.4.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Krzysztof Sywula">Krzysztof.M.Sywula</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>34895</commentid>
    <comment_count>0</comment_count>
    <who name="Krzysztof Sywula">Krzysztof.M.Sywula</who>
    <bug_when>2013-07-25 13:20:37 +0000</bug_when>
    <thetext>Host OS: Debian Wheezy, fresh install
Poky version: tag dylan-9.0.1

This script uses file utility to determine type of compression. When file fails (non-zero return status) assumption is that compression is LZMA. It does not cover simple use case when file is just missing - not installed on host OS.

COMPRESSION=`($EXTRACTOR |file -) 2&gt;/dev/null`
if echo $COMPRESSION |grep -iq gzip; then
        DECOMPRESSOR=gunzip
elif echo $COMPRESSION |grep -iq bzip2; then
        DECOMPRESSOR=bunzip2
elif echo $COMPRESSION |grep -iq xz; then
        DECOMPRESSOR=unxz
elif echo $COMPRESSION |grep -iq cpio; then
        DECOMPRESSOR=cat
else
        # Most versions of file don&apos;t support LZMA, therefore we assume
        # anything not detected is LZMA
        DECOMPRESSOR=`which unlzma 2&gt;/dev/null`

In my case this script tried to unlzma rpmXYZ.tar.gz and failed saying something like &apos;unlzma: unknown format&apos;. 
After installing file problem went away.

There is another script:
poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
which does not use file, but awk to determine type of compression.

The solution would be either:
- add file as Yocto dependency to be installed on host OS
- change the script not to use file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75194</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-07-20 15:18:14 +0000</bug_when>
    <thetext>This got fixed with http://git.yoctoproject.org/cgit.cgi/poky/commit/scripts/rpm2cpio.sh?id=aa17362d339164e8d6c9fcc9d0c24862a191af29 (included in pyro/2.3) - there is no longer a dependency on file in the current script.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>