From af2bcb3fd6997ed0614991c3663025b99644efe4 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Thu, 28 Feb 2013 18:34:48 -0800 Subject: [PATCH] fixed extractor for linux --- extractor/extractor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractor/extractor.py b/extractor/extractor.py index 9325f79d..39da9d36 100644 --- a/extractor/extractor.py +++ b/extractor/extractor.py @@ -63,7 +63,7 @@ def extract(dirpath, file, outputDestination): # ".bz2": ["bzip2", "-d --keep"], EXTRACT_COMMANDS = { - ".rar": ["unrar", "x -o+ -y"], + ".rar": ["unrar", "x"], ".tar": ["tar", "-xf"], ".zip": ["unzip", ""], ".tar.gz": ["tar", "-xzf"], ".tgz": ["tar", "-xzf"], @@ -74,10 +74,10 @@ def extract(dirpath, file, outputDestination): } # Test command exists and if not, remove for cmd in required_cmds: - if not which(cmd): - for k,v in EXTRACT_COMMANDS.items(): + if call(['which', cmd]): #note, returns 0 if exists, or 1 if doesn't exist. + for k, v in EXTRACT_COMMANDS.items(): if cmd in v[0]: - log.error("EXTRACTOR: %s not found, disabling support for %s", cmd, k) + Logger.error("EXTRACTOR: %s not found, disabling support for %s", cmd, k) del EXTRACT_COMMANDS[k] if not EXTRACT_COMMANDS: Logger.warn("EXTRACTOR: No archive extracting programs found, plugin will be disabled")