diff --git a/doc/changelog.txt b/doc/changelog.txt index d3beb1d..1138a2c 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,3 +1,8 @@ +0.8 "" (released xx.xx.xxxx) + + * Fix path error by using absolute pathname for archive when changing + the current working directory to the unpack directory. + 0.7 "3000 Miles to Graceland" (released 8.3.2010) * Added support for ALZIP (.alz) archives. diff --git a/patoolib/programs/arc.py b/patoolib/programs/arc.py index e77d066..f9d4cb0 100644 --- a/patoolib/programs/arc.py +++ b/patoolib/programs/arc.py @@ -14,12 +14,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Archive commands for the arc program.""" +import os 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, 'x', archive] + cmdlist = [cmd, 'x', os.path.abspath(archive)] return (cmdlist, {'cwd': kwargs['outdir']}) def list_arc (archive, encoding, cmd, **kwargs): diff --git a/patoolib/programs/cpio.py b/patoolib/programs/cpio.py index 9ccc67e..8362dcf 100644 --- a/patoolib/programs/cpio.py +++ b/patoolib/programs/cpio.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Archive commands for the cpio program.""" +import os from patoolib import util def extract_cpio (archive, encoding, cmd, **kwargs): @@ -23,7 +24,7 @@ def extract_cpio (archive, encoding, cmd, **kwargs): '--force-local', '--nonmatching', '"*\.\.*"'] if kwargs['verbose']: cmdlist.append('-v') - cmdlist.extend(['<', archive]) + cmdlist.extend(['<', os.path.abspath(archive)]) cmd = " ".join([util.shell_quote(x) for x in cmdlist]) return (cmd, {'cwd': kwargs['outdir'], 'shell': True}) diff --git a/patoolib/programs/lrzip.py b/patoolib/programs/lrzip.py index 1abe287..9cd8962 100644 --- a/patoolib/programs/lrzip.py +++ b/patoolib/programs/lrzip.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Archive commands for the lrzip program.""" +import os from patoolib import util def extract_lrzip (archive, encoding, cmd, **kwargs): @@ -24,7 +25,7 @@ def extract_lrzip (archive, encoding, cmd, **kwargs): if kwargs['verbose']: cmdlist.append('-v') outfile = util.get_single_outfile(kwargs['outdir'], archive) - cmdlist.extend(["-o", outfile, archive]) + cmdlist.extend(["-o", outfile, os.path.abspath(archive)]) return (cmdlist, {'cwd': kwargs['outdir']}) def test_lrzip (archive, encoding, cmd, **kwargs): diff --git a/patoolib/programs/nomarch.py b/patoolib/programs/nomarch.py index 51fd91b..42893aa 100644 --- a/patoolib/programs/nomarch.py +++ b/patoolib/programs/nomarch.py @@ -14,12 +14,13 @@ # 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.""" +import os 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] + cmdlist = [cmd, os.path.abspath(archive)] return (cmdlist, {'cwd': kwargs['outdir']}) def list_arc (archive, encoding, cmd, **kwargs):