2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
9 # This is an old-style rar type
11 # It will detect sets like the following:
25 # Where the PAR2 files protect all files that do not match in basename
26 # with the PAR2 file itself.
29 def detector (name_files, prot_files):
30 return rsutil.common.has_a_match ('^.*\.r00$', prot_files)
33 class OldRAR (PAR2Set.Base.Base):
38 def find_extraction_heads (self):
39 return rsutil.common.find_matches ('^.*\.rar', self.all_files)
41 def extraction_function (self, file, todir):
42 assert os.path.isfile (file)
43 assert os.path.isdir (todir)
45 RAR_CMD = rsutil.common.config_get_value ('commands', 'unrar')
47 cmd = '%s \"%s\"' % (RAR_CMD, file)
48 ret = rsutil.common.run_command (cmd, todir)
52 return -rsutil.common.EEXTRACT
54 return rsutil.common.SUCCESS