Fix rar extraction unpack directory.

This commit is contained in:
Bastian Kleineidam 2010-11-10 19:50:19 +01:00
parent 338e0daaa8
commit 895197e120
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
0.12 "" (released xx.xx.2010) 0.12 "" (released xx.xx.2010)
* Show commands that are run. * Show commands that are run.
* Fix rar extraction unpack directory.
0.11 "Primer" (released 4.10.2010) 0.11 "Primer" (released 4.10.2010)

View File

@ -14,14 +14,15 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Archive commands for the rar program.""" """Archive commands for the rar program."""
import os
def extract_rar (archive, encoding, cmd, **kwargs): def extract_rar (archive, encoding, cmd, **kwargs):
"""Extract a RAR archive.""" """Extract a RAR archive."""
cmdlist = [cmd, 'x'] cmdlist = [cmd, 'x']
if not kwargs['verbose']: if not kwargs['verbose']:
cmdlist.append('-c-') cmdlist.append('-c-')
cmdlist.extend(['-r', '--', archive, kwargs['outdir']]) cmdlist.extend(['-r', '--', os.path.abspath(archive)])
return cmdlist return (cmdlist, {'cwd': kwargs['outdir']})
def list_rar (archive, encoding, cmd, **kwargs): def list_rar (archive, encoding, cmd, **kwargs):
"""List a RAR archive.""" """List a RAR archive."""