Skip to content

Commit

Permalink
Use ar, not tar, to extract .deb
Browse files Browse the repository at this point in the history
gnu-tar is not guaranteed to extract files from a .deb package - ar, however, is
  • Loading branch information
geoghegan authored Mar 22, 2017
1 parent f06ed03 commit c4df12c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions debrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(self, component='main', arch='amd64'):
self.fields = collections.OrderedDict()

def parse_deb(self, debfile):
cmd = 'tar zxf ' + debfile + ' --to-stdout control.tar.gz |' + \
'tar -zxf - --to-stdout control'
cmd = 'ar -p ' + debfile + ' control.tar.gz |' + \
'tar -xzf - --to-stdout ./control'

control = subprocess.check_output(cmd, shell=True)
self.parse_string(control.strip())
Expand Down

0 comments on commit c4df12c

Please sign in to comment.