Patchwork lib/oe/unpack.py: unpack rar archives

login
register
mail settings
Submitter Andreas Oberritter
Date May 16, 2011, 11:41 a.m.
Message ID <1305546074-18796-1-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/4111/
State Accepted
Commit b527db80252906ff0c7c01b3b3438de2e48e0766
Headers show

Comments

Andreas Oberritter - May 16, 2011, 11:41 a.m.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 lib/oe/unpack.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Paul Menzel - May 16, 2011, 1:03 p.m.
Am Montag, den 16.05.2011, 11:41 +0000 schrieb Andreas Oberritter:
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
>  lib/oe/unpack.py |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
> index 8e8bf36..fa517d8 100644
> --- a/lib/oe/unpack.py
> +++ b/lib/oe/unpack.py
> @@ -96,6 +96,8 @@ def unpack_file(file, destdir, parameters, env=None):
>              if dos:
>                  cmd = '%s -a' % cmd
>              cmd = "%s '%s'" % (cmd, file)
> +        elif file.endswith('.rar'):
> +            cmd = 'unrar x %s' % file
>  
>      if not unpack or not cmd:
>          if os.path.isdir(file):

1. What program needs this? I am just asking to be able to test this.
2. Will `unrar-native` automatically be build when such an archive is
encountered?

Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>


Thanks,

Paul
Andreas Oberritter - May 16, 2011, 2 p.m.
On 05/16/2011 03:03 PM, Paul Menzel wrote:
> Am Montag, den 16.05.2011, 11:41 +0000 schrieb Andreas Oberritter:
>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>> ---
>>  lib/oe/unpack.py |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
>> index 8e8bf36..fa517d8 100644
>> --- a/lib/oe/unpack.py
>> +++ b/lib/oe/unpack.py
>> @@ -96,6 +96,8 @@ def unpack_file(file, destdir, parameters, env=None):
>>              if dos:
>>                  cmd = '%s -a' % cmd
>>              cmd = "%s '%s'" % (cmd, file)
>> +        elif file.endswith('.rar'):
>> +            cmd = 'unrar x %s' % file
>>  
>>      if not unpack or not cmd:
>>          if os.path.isdir(file):
> 
> 1. What program needs this? I am just asking to be able to test this.

A recipe in a private layer.

> 2. Will `unrar-native` automatically be build when such an archive is
> encountered?

No. IIRC, adding that dependency created a non-trivial dependency
problem. I figured it would be preferrable to use the host's unrar.

> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>

Thanks,
Andreas

Patch

diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
index 8e8bf36..fa517d8 100644
--- a/lib/oe/unpack.py
+++ b/lib/oe/unpack.py
@@ -96,6 +96,8 @@  def unpack_file(file, destdir, parameters, env=None):
             if dos:
                 cmd = '%s -a' % cmd
             cmd = "%s '%s'" % (cmd, file)
+        elif file.endswith('.rar'):
+            cmd = 'unrar x %s' % file
 
     if not unpack or not cmd:
         if os.path.isdir(file):