diff --git a/doc/todo.txt b/doc/todo.txt index 749c7d7..e69de29 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1 +0,0 @@ -nomarch diff --git a/patoolib/__init__.py b/patoolib/__init__.py index f364f0a..cd56bfe 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -89,6 +89,9 @@ ArchivePrograms = { }, 'arc': { None: ('arc',), + 'extract': ('nomarch',), + 'test': ('nomarch',), + 'list': ('nomarch',), }, 'bzip2': { 'extract': ('pbzip2', 'bzip2', '7z'), diff --git a/patoolib/programs/nomarch.py b/patoolib/programs/nomarch.py new file mode 100644 index 0000000..51fd91b --- /dev/null +++ b/patoolib/programs/nomarch.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2010 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 . +"""Archive commands for the nomarch program.""" + +def extract_arc (archive, encoding, cmd, **kwargs): + """Extract a ARC archive.""" + # Since extracted files will be placed in the current directory, + # the cwd argument has to be the output directory. + cmdlist = [cmd, archive] + return (cmdlist, {'cwd': kwargs['outdir']}) + +def list_arc (archive, encoding, cmd, **kwargs): + """List a ARC archive.""" + cmdlist = [cmd, '-l'] + if kwargs['verbose']: + cmdlist.append('-v') + cmdlist.append(archive) + return cmdlist + +def test_arc (archive, encoding, cmd, **kwargs): + """Test a ARC archive.""" + return [cmd, '-t', archive] diff --git a/tests/test_archives.py b/tests/test_archives.py index 7d892c7..5e97034 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -295,3 +295,10 @@ class TestArchives (ArchiveTest): def test_arc (self): self.program = 'arc' self.archive_commands('t.arc', singlefile=True) + + @needs_program('nomarch') + def test_nomarch (self): + self.program = 'nomarch' + self.archive_test('t.arc') + self.archive_list('t.arc') + self.archive_extract('t.arc') diff --git a/tests/test_foo_archives.py b/tests/test_foo_archives.py index c703685..a2dccb6 100644 --- a/tests/test_foo_archives.py +++ b/tests/test_foo_archives.py @@ -340,3 +340,10 @@ class TestArchives (ArchiveTest): def test_arc (self): self.program = 'arc' self.archive_commands('t.arc.foo', format="arc", singlefile=True) + + @needs_program('nomarch') + def test_nomarch (self): + self.program = 'nomarch' + self.archive_test('t.arc.foo') + self.archive_list('t.arc.foo') + self.archive_extract('t.arc.foo')