Fix rzip archive handling.

This commit is contained in:
Bastian Kleineidam 2013-02-23 09:01:15 +01:00
parent 7006c51d53
commit 165411a54a
5 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* Add support for grepping in archive contents.
* Fixed Python lzma archive handling.
* Fixed lzop and lrzip archive handling.
* Fixed lzop, lrzip and rzip archive handling.
0.19 "The Kids Are All Right" (released 21.2.2013)

View File

@ -13,23 +13,21 @@
#
# 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 lrzip program."""
"""Archive commands for the rzip program."""
import os
from .. import util
def extract_rzip (archive, compression, cmd, **kwargs):
"""Extract a RZIP archive."""
# Since extracted files will be placed in the current directory,
# the cwd argument has to be the output directory.
"""Extract an RZIP archive."""
cmdlist = [cmd, '-d', '-k']
if kwargs['verbose']:
cmdlist.append('-v')
outfile = util.get_single_outfile(kwargs['outdir'], archive)
cmdlist.extend(["-o", outfile, os.path.abspath(archive)])
return (cmdlist, {'cwd': kwargs['outdir']})
cmdlist.extend(["-o", outfile, archive])
return cmdlist
def create_rzip (archive, compression, cmd, *args, **kwargs):
"""Create a RZIP archive."""
"""Create an RZIP archive."""
cmdlist = [cmd, '-k', '-o', archive]
if kwargs['verbose']:
cmdlist.append('-v')

View File

@ -22,10 +22,10 @@ class TestRzip (ArchiveTest):
@needs_program(program)
def test_rzip(self):
self.archive_extract('t.txt.rz')
self.archive_extract('t.txt.rz', check=Content.Singlefile)
self.archive_create('t.txt.rz', check=Content.Singlefile)
@needs_program(program)
def test_rzip_file(self):
self.archive_extract('t.txt.rz.foo')
self.archive_extract('t.txt.rz.foo', check=Content.Singlefile)

Binary file not shown.

Binary file not shown.