Skip to content

Commit

Permalink
Fix 7z unpacking when only p7zip with /usr/bin/7zr is installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wummel committed Jan 9, 2016
1 parent bd91cce commit 1d121c4
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 5 deletions.
5 changes: 5 additions & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.11 (released xx.xx.216)

* Fix 7z unpacking when only p7zip with /usr/bin/7zr is installed.


1.10 (released 10.12.2015)

* Added support for VHD (Virtual Hard Disk) archives with 7z.
Expand Down
3 changes: 2 additions & 1 deletion patoolib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
'create': ('compress',),
},
'7z': {
None: ('7z', '7za'),
None: ('7z', '7za', '7zr'),
},
'rar': {
None: ('rar',),
Expand Down Expand Up @@ -277,6 +277,7 @@
ProgramModules = {
'7z': 'p7zip',
'7za': 'p7azip',
'7zr': 'p7rzip',
'uncompress.real': 'uncompress',
'dpkg-deb': 'dpkg',
'extract_chmlib': 'chmlib',
Expand Down
25 changes: 25 additions & 0 deletions patoolib/programs/p7rzip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Bastian Kleineidam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Archive commands for the 7zr program.
7zr is a light executable supporting only the 7z archive format.
"""

from .p7zip import \
extract_7z, \
list_7z, \
test_7z, \
create_7z
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@
raise SystemExit("This program requires Python 2.7 or later.")
import os
import re
import shutil
import glob
import subprocess
from setuptools import setup
from distutils.core import Distribution
from distutils.command.install_lib import install_lib
from distutils import util
from distutils.file_util import write_file

AppName = "patool"
AppVersion = "1.10"
AppVersion = "1.11"
MyName = "Bastian Kleineidam"
MyEmail = "[email protected]"

Expand Down
30 changes: 30 additions & 0 deletions tests/archives/test_7zr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2015 Bastian Kleineidam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import ArchiveTest
from .. import needs_program

class Test7zr (ArchiveTest):

program = '7zr'

@needs_program(program)
def test_7zr (self):
self.archive_commands('t .7z')

@needs_program('file')
@needs_program(program)
def test_7z_file (self):
self.archive_commands('t.7z.foo', skip_create=True)

0 comments on commit 1d121c4

Please sign in to comment.