summaryrefslogtreecommitdiff
path: root/libre/calibre/libre.patch
blob: 739322d7aab88830b2a6e0cc510c8509a9d9b25d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
diff --git a/resources/mime.types b/resources/mime.types
index b8acaaa25..9ea4742a6 100644
--- a/resources/mime.types
+++ b/resources/mime.types
@@ -138,7 +138,6 @@ application/prs.cww				cww
 application/prs.nprend
 application/prs.plucker
 application/qsig
-application/rar				rar
 application/rdf+xml				rdf
 application/reginfo+xml				rif
 application/relax-ng-compact-syntax				rnc
@@ -849,7 +848,6 @@ application/x-pkcs7-certreqresp				p7r
 application/x-pkcs7-crl				crl
 application/x-python-code				pyc pyo
 application/x-quicktimeplayer				qtl
-application/x-rar-compressed				rar
 application/x-redhat-package-manager				rpm
 application/x-sh				sh
 application/x-shar				shar
@@ -1372,7 +1370,6 @@ application/x-mobipocket-subscription      pobi
 application/x-kindle-application           azw2
 application/x-mobi8-ebook                  azw3
 application/x-cbz                          cbz
-application/x-cbr                          cbr
 application/x-cb7                          cb7
 application/x-cbc                          cbc
 application/x-koboreader-ebook             kobo
diff --git a/session.vim b/session.vim
index d5ecb06a3..b3e40d0da 100644
--- a/session.vim
+++ b/session.vim
@@ -11,7 +11,6 @@ let g:syntastic_cpp_include_dirs = [
             \'/usr/include/freetype2',
             \'/usr/include/fontconfig',
             \'src/qtcurve/common', 'src/qtcurve',
-            \'src/unrar',
             \'src/qt-harfbuzz/src',
             \'/usr/include/ImageMagick',
             \]
diff --git a/setup/extensions.json b/setup/extensions.json
index 1f6d1fb5f..127390450 100644
--- a/setup/extensions.json
+++ b/setup/extensions.json
@@ -211,16 +211,5 @@
         "sources": "calibre/devices/mtp/unix/devices.c calibre/devices/mtp/unix/libmtp.c",
         "headers": "calibre/devices/mtp/unix/devices.h calibre/devices/mtp/unix/upstream/music-players.h calibre/devices/mtp/unix/upstream/device-flags.h",
         "libraries": "mtp"
-    },
-    {
-        "name": "unrar",
-        "sources": "unrar/rar.cpp unrar/strlist.cpp unrar/strfn.cpp unrar/pathfn.cpp unrar/savepos.cpp unrar/smallfn.cpp unrar/global.cpp unrar/file.cpp unrar/filefn.cpp unrar/filcreat.cpp unrar/archive.cpp unrar/arcread.cpp unrar/unicode.cpp unrar/system.cpp unrar/isnt.cpp unrar/crypt.cpp unrar/crc.cpp unrar/rawread.cpp unrar/encname.cpp unrar/resource.cpp unrar/match.cpp unrar/timefn.cpp unrar/rdwrfn.cpp unrar/consio.cpp unrar/options.cpp unrar/ulinks.cpp unrar/errhnd.cpp unrar/rarvm.cpp unrar/secpassword.cpp unrar/rijndael.cpp unrar/getbits.cpp unrar/sha1.cpp unrar/extinfo.cpp unrar/extract.cpp unrar/volume.cpp unrar/list.cpp unrar/find.cpp unrar/unpack.cpp unrar/cmddata.cpp unrar/filestr.cpp unrar/scantree.cpp calibre/utils/unrar.cpp",
-        "inc_dirs": "unrar",
-        "defines": "SILENT RARDLL UNRAR _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE",
-        "windows_defines": "SILENT RARDLL UNRAR",
-        "haiku_defines": "LITTLE_ENDIAN SILENT RARDLL UNRAR _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE _BSD_SOURCE",
-        "haiku_libraries": "bsd",
-        "optimize_level": 2,
-        "windows_libraries": "User32 Advapi32 kernel32 Shell32"
     }
 ]
diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py
index 539ec35ff..f0537d916 100644
--- a/setup/installer/windows/freeze.py
+++ b/setup/installer/windows/freeze.py
@@ -674,7 +674,7 @@ class Win32Freeze(Command, WixMixIn):
                         # Because of https://github.com/fancycode/MemoryModule/issues/4
                         # any extensions that use C++ exceptions must be loaded
                         # from files
-                        'unrar.pyd', 'wpd.pyd', 'podofo.pyd', 'imageops.pyd',
+                        'wpd.pyd', 'podofo.pyd', 'imageops.pyd',
                         'progress_indicator.pyd', 'hunspell.pyd',
                         # dupypy crashes when loaded from the zip file
                         'dukpy.pyd',
diff --git a/setup/resources.py b/setup/resources.py
index d3c9614c6..6946b93f4 100644
--- a/setup/resources.py
+++ b/setup/resources.py
@@ -364,7 +364,7 @@ class Resources(Command):  # {{{
             log = Log()
             # log.outputs = []
             for inf in supported_input_formats():
-                if inf in ('zip', 'rar', 'oebzip'):
+                if inf in ('zip', 'oebzip'):
                     continue
                 for ouf in available_output_formats():
                     of = ouf if ouf == 'oeb' else 'dummy.'+ouf
diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py
index dfd897ba0..105578388 100644
--- a/src/calibre/__init__.py
+++ b/src/calibre/__init__.py
@@ -292,10 +292,7 @@ def extract(path, dir):
     # First use the file header to identify its type
     with open(path, 'rb') as f:
         id_ = f.read(3)
-    if id_ == b'Rar':
-        from calibre.utils.unrar import extract as rarextract
-        extractor = rarextract
-    elif id_.startswith(b'PK'):
+    if id_.startswith(b'PK'):
         from calibre.libunzip import extract as zipextract
         extractor = zipextract
     if extractor is None:
@@ -304,9 +301,6 @@ def extract(path, dir):
         if ext in ['zip', 'cbz', 'epub', 'oebzip']:
             from calibre.libunzip import extract as zipextract
             extractor = zipextract
-        elif ext in ['cbr', 'rar']:
-            from calibre.utils.unrar import extract as rarextract
-            extractor = rarextract
     if extractor is None:
         raise Exception('Unknown archive type')
     extractor(path, dir)
diff --git a/src/calibre/constants.py b/src/calibre/constants.py
index 3952b06da..87e42b4a8 100644
--- a/src/calibre/constants.py
+++ b/src/calibre/constants.py
@@ -154,7 +154,6 @@ class Plugins(collections.Mapping):
                 'zlib2',
                 'html',
                 'freetype',
-                'unrar',
                 'imageops',
                 'qt_hack',
                 '_regex',
diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py
index 102bc8149..25a877c02 100644
--- a/src/calibre/customize/builtins.py
+++ b/src/calibre/customize/builtins.py
@@ -131,7 +131,7 @@ plugins += [HTML2ZIP, PML2PMLZ, TXT2TXTZ, ArchiveExtract,]
 class ComicMetadataReader(MetadataReaderPlugin):
 
     name = 'Read comic metadata'
-    file_types = set(['cbr', 'cbz'])
+    file_types = set(['cbz'])
     description = _('Extract cover from comic files')
 
     def customization_help(self, gui=False):
@@ -142,19 +142,14 @@ class ComicMetadataReader(MetadataReaderPlugin):
             pos = stream.tell()
             id_ = stream.read(3)
             stream.seek(pos)
-            if id_ == b'Rar':
-                ftype = 'cbr'
-            elif id_.startswith(b'PK'):
+            if id_.startswith(b'PK'):
                 ftype = 'cbz'
-        if ftype == 'cbr':
-            from calibre.utils.unrar import extract_cover_image
-        else:
             from calibre.libunzip import extract_cover_image
         from calibre.ebooks.metadata import MetaInformation
         ret = extract_cover_image(stream)
         mi = MetaInformation(None, None)
         stream.seek(0)
-        if ftype in {'cbr', 'cbz'}:
+        if ftype in {'cbz'}:
             series_index = self.site_customization
             if series_index not in {'volume', 'issue'}:
                 series_index = 'volume'
@@ -353,17 +348,6 @@ class PMLMetadataReader(MetadataReaderPlugin):
         return get_metadata(stream)
 
 
-class RARMetadataReader(MetadataReaderPlugin):
-
-    name = 'Read RAR metadata'
-    file_types = set(['rar'])
-    description = _('Read metadata from ebooks in RAR archives')
-
-    def get_metadata(self, stream, ftype):
-        from calibre.ebooks.metadata.rar import get_metadata
-        return get_metadata(stream)
-
-
 class RBMetadataReader(MetadataReaderPlugin):
 
     name        = 'Read RB metadata'
diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py
index 9b5eb17fb..87233d03b 100644
--- a/src/calibre/customize/ui.py
+++ b/src/calibre/customize/ui.py
@@ -526,7 +526,7 @@ def available_input_formats():
         if not is_disabled(plugin):
             for format in plugin.file_types:
                 formats.add(format)
-    formats.add('zip'), formats.add('rar')
+    formats.add('zip')
     return formats
 
 
diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py
index a4bc8639b..ae9e437e9 100644
--- a/src/calibre/devices/kobo/driver.py
+++ b/src/calibre/devices/kobo/driver.py
@@ -78,7 +78,7 @@ class KOBO(USBMS):
     book_class = Book
 
     # Ordered list of supported formats
-    FORMATS     = ['kepub', 'epub', 'pdf', 'txt', 'cbz', 'cbr']
+    FORMATS     = ['kepub', 'epub', 'pdf', 'txt', 'cbz']
     CAN_SET_METADATA = ['collections']
 
     VENDOR_ID           = [0x2237]
diff --git a/src/calibre/devices/mtp/filesystem_cache.py b/src/calibre/devices/mtp/filesystem_cache.py
index ffc52806d..79be51ed7 100644
--- a/src/calibre/devices/mtp/filesystem_cache.py
+++ b/src/calibre/devices/mtp/filesystem_cache.py
@@ -18,7 +18,7 @@ from calibre.utils.date import local_tz, as_utc
 from calibre.utils.icu import sort_key, lower
 from calibre.ebooks import BOOK_EXTENSIONS
 
-bexts = frozenset(BOOK_EXTENSIONS) - {'mbp', 'tan', 'rar', 'zip', 'xml'}
+bexts = frozenset(BOOK_EXTENSIONS) - {'mbp', 'tan', 'zip', 'xml'}
 
 
 class FileOrFolder(object):
diff --git a/src/calibre/ebooks/__init__.py b/src/calibre/ebooks/__init__.py
index 785d964ed..f8c01e55b 100644
--- a/src/calibre/ebooks/__init__.py
+++ b/src/calibre/ebooks/__init__.py
@@ -30,9 +30,9 @@ class ParserError(ValueError):
     pass
 
 
-BOOK_EXTENSIONS = ['lrf', 'rar', 'zip', 'rtf', 'lit', 'txt', 'txtz', 'text', 'htm', 'xhtm',
+BOOK_EXTENSIONS = ['lrf', 'zip', 'rtf', 'lit', 'txt', 'txtz', 'text', 'htm', 'xhtm',
                    'html', 'htmlz', 'xhtml', 'pdf', 'pdb', 'updb', 'pdr', 'prc', 'mobi', 'azw', 'doc',
-                   'epub', 'fb2', 'djv', 'djvu', 'lrx', 'cbr', 'cbz', 'cbc', 'oebzip',
+                   'epub', 'fb2', 'djv', 'djvu', 'lrx', 'cbz', 'cbc', 'oebzip',
                    'rb', 'imp', 'odt', 'chm', 'tpz', 'azw1', 'pml', 'pmlz', 'mbp', 'tan', 'snb',
                    'xps', 'oxps', 'azw4', 'book', 'zbf', 'pobi', 'docx', 'docm', 'md',
                    'textile', 'markdown', 'ibook', 'ibooks', 'iba', 'azw3', 'ps', 'kepub']
diff --git a/src/calibre/ebooks/conversion/plugins/comic_input.py b/src/calibre/ebooks/conversion/plugins/comic_input.py
index 882501462..acc1f1bd3 100644
--- a/src/calibre/ebooks/conversion/plugins/comic_input.py
+++ b/src/calibre/ebooks/conversion/plugins/comic_input.py
@@ -18,8 +18,8 @@ class ComicInput(InputFormatPlugin):
 
     name        = 'Comic Input'
     author      = 'Kovid Goyal'
-    description = 'Optimize comic files (.cbz, .cbr, .cbc) for viewing on portable devices'
-    file_types  = set(['cbz', 'cbr', 'cbc'])
+    description = 'Optimize comic files (.cbz, .cbc) for viewing on portable devices'
+    file_types  = set(['cbz', 'cbc'])
     is_image_collection = True
     core_usage = -1
 
diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py
index f85199a01..c429f1130 100644
--- a/src/calibre/ebooks/conversion/plumber.py
+++ b/src/calibre/ebooks/conversion/plumber.py
@@ -43,7 +43,7 @@ various stages of conversion. The stages are:
 
 def supported_input_formats():
     fmts = available_input_formats()
-    for x in ('zip', 'rar', 'oebzip'):
+    for x in ('zip', 'oebzip'):
         fmts.add(x)
     return fmts
 
@@ -64,7 +64,7 @@ class CompositeProgressReporter(object):
         self.global_reporter(global_frac, msg)
 
 
-ARCHIVE_FMTS = ('zip', 'rar', 'oebzip')
+ARCHIVE_FMTS = ('zip', 'oebzip')
 
 
 class Plumber(object):
diff --git a/src/calibre/ebooks/metadata/archive.py b/src/calibre/ebooks/metadata/archive.py
index 938ab24bc..0494bc5e3 100644
--- a/src/calibre/ebooks/metadata/archive.py
+++ b/src/calibre/ebooks/metadata/archive.py
@@ -29,8 +29,6 @@ def archive_type(stream):
     ans = None
     if id_ == stringFileHeader:
         ans = 'zip'
-    elif id_.startswith('Rar'):
-        ans = 'rar'
     try:
         stream.seek(pos)
     except:
@@ -42,25 +40,16 @@ class ArchiveExtract(FileTypePlugin):
     name = 'Archive Extract'
     author = 'Kovid Goyal'
     description = _('Extract common e-book formats from archives '
-        '(zip/rar) files. Also try to autodetect if they are actually '
-        'cbz/cbr files.')
-    file_types = set(['zip', 'rar'])
+        'zip files. Also try to autodetect if they are actually '
+        'cbz files.')
+    file_types = set(['zip'])
     supported_platforms = ['windows', 'osx', 'linux']
     on_import = True
 
     def run(self, archive):
         from calibre.utils.zipfile import ZipFile
-        is_rar = archive.lower().endswith('.rar')
-        if is_rar:
-            from calibre.utils.unrar import extract_member, names
-        else:
-            zf = ZipFile(archive, 'r')
-
-        if is_rar:
-            with open(archive, 'rb') as rf:
-                fnames = list(names(rf))
-        else:
-            fnames = zf.namelist()
+        zf = ZipFile(archive, 'r')
+        fnames = zf.namelist()
 
         def fname_ok(fname):
             bn = os.path.basename(fname).lower()
@@ -76,7 +65,7 @@ class ArchiveExtract(FileTypePlugin):
 
         fnames = list(filter(fname_ok, fnames))
         if is_comic(fnames):
-            ext = '.cbr' if is_rar else '.cbz'
+            ext = '.cbz'
             of = self.temporary_file('_archive_extract'+ext)
             with open(archive, 'rb') as f:
                 of.write(f.read())
@@ -93,12 +82,7 @@ class ArchiveExtract(FileTypePlugin):
 
         of = self.temporary_file('_archive_extract.'+ext)
         with closing(of):
-            if is_rar:
-                with open(archive, 'rb') as f:
-                    data = extract_member(f, match=None, name=fname)[1]
-                of.write(data)
-            else:
-                of.write(zf.read(fname))
+            of.write(zf.read(fname))
         return of.name
 
 
@@ -161,10 +145,6 @@ def get_comic_metadata(stream, stream_type, series_index='volume'):
         from calibre.utils.zipfile import ZipFile
         zf = ZipFile(stream)
         comment = zf.comment
-    elif stream_type == 'cbr':
-        from calibre.utils.unrar import RARFile
-        f = RARFile(stream, get_comment=True)
-        comment = f.comment
 
     if comment:
         import json
diff --git a/src/calibre/ebooks/oeb/iterator/book.py b/src/calibre/ebooks/oeb/iterator/book.py
index 08208c915..ff37b807f 100644
--- a/src/calibre/ebooks/oeb/iterator/book.py
+++ b/src/calibre/ebooks/oeb/iterator/book.py
@@ -152,7 +152,7 @@ class EbookIterator(BookmarksMixin):
         self.spine = []
         Spiny = partial(SpineItem, read_anchor_map=read_anchor_map, read_links=read_links,
                 run_char_count=run_char_count, from_epub=self.book_format == 'EPUB')
-        is_comic = input_fmt.lower() in {'cbc', 'cbz', 'cbr', 'cb7'}
+        is_comic = input_fmt.lower() in {'cbc', 'cbz', 'cb7'}
         for i in ordered:
             spath = i.path
             mt = None
diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py
index d2f628294..c1a92b8dd 100644
--- a/src/calibre/gui2/actions/add.py
+++ b/src/calibre/gui2/actions/add.py
@@ -39,8 +39,8 @@ def get_filters():
             (_('Text books'), ['txt', 'text', 'rtf']),
             (_('PDF Books'), ['pdf', 'azw4']),
             (_('SNB Books'), ['snb']),
-            (_('Comics'), ['cbz', 'cbr', 'cbc']),
-            (_('Archives'), ['zip', 'rar']),
+            (_('Comics'), ['cbz', 'cbc']),
+            (_('Archives'), ['zip']),
             (_('Wordprocessor files'), ['odt', 'doc', 'docx']),
     ]
 
@@ -67,7 +67,7 @@ class AddAction(InterfaceAction):
             'sub-directories (Multiple books per directory, assumes every '
             'ebook file is a different book)')).triggered.connect(
                     self.add_recursive_multiple)
-        arm = self.add_archive_menu = self.add_menu.addMenu(_('Add multiple books from archive (ZIP/RAR)'))
+        arm = self.add_archive_menu = self.add_menu.addMenu(_('Add multiple books from archive (ZIP)'))
         self.create_menu_action(arm, 'recursive-single-archive', _(
             'One book per directory in the archive')).triggered.connect(partial(self.add_archive, True))
         self.create_menu_action(arm, 'recursive-multiple-archive', _(
@@ -200,7 +200,7 @@ class AddAction(InterfaceAction):
     def add_archive(self, single):
         paths = choose_files(
             self.gui, 'recursive-archive-add', _('Choose archive file'),
-            filters=[(_('Archives'), ('zip', 'rar'))], all_files=False, select_only_single_file=False)
+            filters=[(_('Archives'), ('zip'))], all_files=False, select_only_single_file=False)
         if paths:
             self.do_add_recursive(paths, single, list_of_archives=True)
 
diff --git a/src/calibre/gui2/add.py b/src/calibre/gui2/add.py
index 5adb28604..b60f2a9fc 100644
--- a/src/calibre/gui2/add.py
+++ b/src/calibre/gui2/add.py
@@ -147,9 +147,6 @@ class Adder(QObject):
                     prints('Corrupt ZIP file, trying to use local headers')
                     from calibre.utils.localunzip import extractall
                     extractall(source, tdir)
-            elif source.lower().endswith('.rar'):
-                from calibre.utils.unrar import extract
-                extract(source, tdir)
             return tdir
 
         try:
diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py
index 34157a0c5..718af59f1 100644
--- a/src/calibre/library/server/opds.py
+++ b/src/calibre/library/server/opds.py
@@ -28,7 +28,7 @@ BASE_HREFS = {
         1 : '/opds',
 }
 
-STANZA_FORMATS = frozenset(['epub', 'pdb', 'pdf', 'cbr', 'cbz', 'djvu'])
+STANZA_FORMATS = frozenset(['epub', 'pdb', 'pdf', 'cbz', 'djvu'])
 
 
 def url_for(name, version, **kwargs):
diff --git a/src/calibre/linux.py b/src/calibre/linux.py
index a098ea630..163aa38bc 100644
--- a/src/calibre/linux.py
+++ b/src/calibre/linux.py
@@ -317,7 +317,7 @@ class ZshCompleter(object):  # {{{
         ):
             for fmt in fmts:
                 is_input = group_title == input_group
-                if is_input and fmt in {'rar', 'zip', 'oebzip'}:
+                if is_input and fmt in {'zip', 'oebzip'}:
                     continue
                 p = (get_parser(input_fmt=fmt) if is_input
                      else get_parser(output_fmt=fmt))
diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py
index f11c08b26..3176389b8 100644
--- a/src/calibre/test_build.py
+++ b/src/calibre/test_build.py
@@ -168,10 +168,6 @@ class BuildTest(unittest.TestCase):
         from calibre.gui2.win_file_dialogs import test
         test()
 
-    def test_unrar(self):
-        from calibre.utils.unrar import test_basic
-        test_basic()
-
     @unittest.skipUnless(iswindows, 'WPD is windows only')
     def test_wpd(self):
         wpd = plugins['wpd'][0]
diff --git a/src/calibre/utils/search_query_parser.py b/src/calibre/utils/search_query_parser.py
index fe04af0b3..130fb81ec 100644
--- a/src/calibre/utils/search_query_parser.py
+++ b/src/calibre/utils/search_query_parser.py
@@ -455,16 +455,16 @@ class Tester(SearchQueryParser):
      u'Tor Books',
      u'lrf'],
  8: [u'Stalky and Co.', u'Rudyard Kipling', u'manybooks.net', u'lrf'],
- 9: [u'A Game of Thrones', u'George R. R. Martin', None, u'lrf,rar'],
- 10: [u'A Clash of Kings', u'George R. R. Martin', None, u'lrf,rar'],
- 11: [u'A Storm of Swords', u'George R. R. Martin', None, u'lrf,rar'],
+ 9: [u'A Game of Thrones', u'George R. R. Martin', None, u'lrf'],
+ 10: [u'A Clash of Kings', u'George R. R. Martin', None, u'lrf'],
+ 11: [u'A Storm of Swords', u'George R. R. Martin', None, u'lrf'],
  12: [u'Biggles - Pioneer Air Fighter', u'W. E. Johns', None, u'lrf,rtf'],
  13: [u'Biggles of the Camel Squadron',
       u'W. E. Johns',
       u'London:Thames, (1977)',
       u'lrf,rtf'],
- 14: [u'A Feast for Crows', u'George R. R. Martin', None, u'lrf,rar'],
- 15: [u'Cryptonomicon', u'Neal Stephenson', None, u'lrf,rar'],
+ 14: [u'A Feast for Crows', u'George R. R. Martin', None, u'lrf'],
+ 15: [u'Cryptonomicon', u'Neal Stephenson', None, u'lrf'],
  16: [u'Quicksilver', u'Neal Stephenson', None, u'lrf,zip'],
  17: [u'The Comedies of William Shakespeare',
       u'William Shakespeare',
@@ -479,15 +479,15 @@ class Tester(SearchQueryParser):
       None,
       u'lrf'],
  20: [u'An Ideal Husband', u'Oscar Wilde', u'manybooks.net', u'lrf'],
- 21: [u'Flight of the Nighthawks', u'Raymond E. Feist', None, u'lrf,rar'],
- 22: [u'Into a Dark Realm', u'Raymond E. Feist', None, u'lrf,rar'],
- 23: [u'The Sundering', u'Walter Jon Williams', None, u'lrf,rar'],
- 24: [u'The Praxis', u'Walter Jon Williams', None, u'lrf,rar'],
- 25: [u'Conventions of War', u'Walter Jon Williams', None, u'lrf,rar'],
- 26: [u'Banewreaker', u'Jacqueline Carey', None, u'lrf,rar'],
- 27: [u'Godslayer', u'Jacqueline Carey', None, u'lrf,rar'],
- 28: [u"Kushiel's Scion", u'Jacqueline Carey', None, u'lrf,rar'],
- 29: [u'Underworld', u'Don DeLillo', None, u'lrf,rar'],
+ 21: [u'Flight of the Nighthawks', u'Raymond E. Feist', None, u'lrf'],
+ 22: [u'Into a Dark Realm', u'Raymond E. Feist', None, u'lrf'],
+ 23: [u'The Sundering', u'Walter Jon Williams', None, u'lrf'],
+ 24: [u'The Praxis', u'Walter Jon Williams', None, u'lrf'],
+ 25: [u'Conventions of War', u'Walter Jon Williams', None, u'lrf'],
+ 26: [u'Banewreaker', u'Jacqueline Carey', None, u'lrf'],
+ 27: [u'Godslayer', u'Jacqueline Carey', None, u'lrf'],
+ 28: [u"Kushiel's Scion", u'Jacqueline Carey', None, u'lrf'],
+ 29: [u'Underworld', u'Don DeLillo', None, u'lrf'],
  30: [u'Genghis Khan and The Making of the Modern World',
       u'Jack Weatherford Orc',
       u'Three Rivers Press',
@@ -498,9 +498,9 @@ class Tester(SearchQueryParser):
       u'lrf,zip'],
  32: [u'The Killer Angels', u'Michael Shaara', None, u'html,lrf'],
  33: [u'Band Of Brothers', u'Stephen E Ambrose', None, u'lrf,txt'],
- 34: [u'The Gates of Rome', u'Conn Iggulden', None, u'lrf,rar'],
+ 34: [u'The Gates of Rome', u'Conn Iggulden', None, u'lrf'],
  35: [u'The Death of Kings', u'Conn Iggulden', u'Bantam Dell', u'lit,lrf'],
- 36: [u'The Field of Swords', u'Conn Iggulden', None, u'lrf,rar'],
+ 36: [u'The Field of Swords', u'Conn Iggulden', None, u'lrf'],
  37: [u'Masterman Ready', u'Marryat, Captain Frederick', None, u'lrf'],
  38: [u'With the Lightnings',
       u'David Drake',
@@ -513,16 +513,16 @@ class Tester(SearchQueryParser):
  40: [u'The Far Side of The Stars',
       u'David Drake',
       u'Baen Publishing Enterprises',
-      u'lrf,rar'],
+      u'lrf'],
  41: [u'The Way to Glory',
       u'David Drake',
       u'Baen Publishing Enterprises',
-      u'lrf,rar'],
- 42: [u'Some Golden Harbor', u'David Drake', u'Baen Books', u'lrf,rar'],
+      u'lrf'],
+ 42: [u'Some Golden Harbor', u'David Drake', u'Baen Books', u'lrf'],
  43: [u'Harry Potter And The Half-Blood Prince',
       u'J. K. Rowling',
       None,
-      u'lrf,rar'],
+      u'lrf'],
  44: [u'Harry Potter and the Order of the Phoenix',
       u'J. K. Rowling',
       None,
@@ -531,12 +531,12 @@ class Tester(SearchQueryParser):
  46: [u'The Stars at War II',
       u'Steve White',
       u'Baen Publishing Enterprises',
-      u'lrf,rar'],
- 47: [u'Exodus', u'Steve White,Shirley Meier', u'Baen Books', u'lrf,rar'],
+      u'lrf'],
+ 47: [u'Exodus', u'Steve White,Shirley Meier', u'Baen Books', u'lrf'],
  48: [u'Harry Potter and the Goblet of Fire',
       u'J. K. Rowling',
       None,
-      u'lrf,rar'],
+      u'lrf'],
  49: [u'Harry Potter and the Prisoner of Azkaban',
       u'J. K. Rowling',
       None,
@@ -549,20 +549,20 @@ class Tester(SearchQueryParser):
       u'J.K. Rowling',
       None,
       u'lit,lrf,pdf'],
- 52: [u"His Majesty's Dragon", u'Naomi Novik', None, u'lrf,rar'],
+ 52: [u"His Majesty's Dragon", u'Naomi Novik', None, u'lrf'],
  53: [u'Throne of Jade', u'Naomi Novik', u'Del Rey', u'lit,lrf'],
- 54: [u'Black Powder War', u'Naomi Novik', u'Del Rey', u'lrf,rar'],
+ 54: [u'Black Powder War', u'Naomi Novik', u'Del Rey', u'lrf'],
  55: [u'War and Peace', u'Leo Tolstoy', u'gutenberg.org', u'lrf,txt'],
  56: [u'Anna Karenina', u'Leo Tolstoy', u'gutenberg.org', u'lrf,txt'],
  57: [u'A Shorter History of Rome',
       u'Eugene Lawrence,Sir William Smith',
       u'gutenberg.org',
       u'lrf,zip'],
- 58: [u'The Name of the Rose', u'Umberto Eco', None, u'lrf,rar'],
+ 58: [u'The Name of the Rose', u'Umberto Eco', None, u'lrf'],
  71: [u"Wind Rider's Oath", u'David Weber', u'Baen', u'lrf'],
  74: [u'Rally Cry', u'William R Forstchen', None, u'htm,lrf'],
- 86: [u'Empire of Ivory', u'Naomi Novik', None, u'lrf,rar'],
- 87: [u"Renegade's Magic", u'Robin Hobb', None, u'lrf,rar'],
+ 86: [u'Empire of Ivory', u'Naomi Novik', None, u'lrf'],
+ 87: [u"Renegade's Magic", u'Robin Hobb', None, u'lrf'],
  89: [u'Master and commander',
       u"Patrick O'Brian",
       u'Fontana,\n1971',
@@ -570,7 +570,7 @@ class Tester(SearchQueryParser):
  91: [u'A Companion to Wolves',
       u'Sarah Monette,Elizabeth Beär',
       None,
-      u'lrf,rar'],
+      u'lrf'],
  92: [u'The Lions of al-Rassan', u'Guy Gavriel Kay', u'Eos', u'lit,lrf'],
  93: [u'Gardens of the Moon', u'Steven Erikson', u'Tor Fantasy', u'lit,lrf'],
  95: [u'The Master and Margarita',
@@ -594,7 +594,7 @@ class Tester(SearchQueryParser):
  144: [u'Atonement',
        u'Ian McEwan',
        u'New York : Nan A. Talese/Doubleday, 2002.',
-       u'lrf,rar'],
+       u'lrf'],
  146: [u'1632', u'Eric Flint', u'Baen Books', u'lit,lrf'],
  147: [u'1633', u'David Weber,Eric Flint,Dru Blair', u'Baen', u'lit,lrf'],
  148: [u'1634: The Baltic War',
@@ -647,7 +647,7 @@ class Tester(SearchQueryParser):
  253: [u"Hunter's Run",
        u'George R. R. Martin,Gardner Dozois,Daniel Abraham',
        u'Eos',
-       u'lrf,rar'],
+       u'lrf'],
  257: [u'Knife of Dreams', u'Robert Jordan', None, u'lit,lrf'],
  258: [u'Saturday',
        u'Ian McEwan',
@@ -667,7 +667,7 @@ class Tester(SearchQueryParser):
        u'New York : Random House, 2005.',
        u'lit,lrf'],
  269: [u'Reap the Whirlwind', u'David Mack', u'Star Trek', u'lit,lrf'],
- 272: [u'Mistborn', u'Brandon Sanderson', u'Tor Fantasy', u'lrf,rar'],
+ 272: [u'Mistborn', u'Brandon Sanderson', u'Tor Fantasy', u'lrf'],
  273: [u'The Thousandfold Thought',
        u'R. Scott Bakker',
        u'Overlook TP',
@@ -675,17 +675,17 @@ class Tester(SearchQueryParser):
  276: [u'Elantris',
        u'Brandon Sanderson',
        u'New York : Tor, 2005.',
-       u'lrf,rar'],
+       u'lrf'],
  291: [u'Sundiver',
        u'David Brin',
        u'New York : Bantam Books, 1995.',
        u'lit,lrf'],
- 299: [u'Imperium', u'Robert Harris', u'Arrow', u'lrf,rar'],
+ 299: [u'Imperium', u'Robert Harris', u'Arrow', u'lrf'],
  300: [u'Startide Rising', u'David Brin', u'Bantam', u'htm,lrf'],
  301: [u'The Uplift War', u'David Brin', u'Spectra', u'lit,lrf'],
- 304: [u'Brightness Reef', u'David Brin', u'Orbit', u'lrf,rar'],
+ 304: [u'Brightness Reef', u'David Brin', u'Orbit', u'lrf'],
  305: [u"Infinity's Shore", u'David Brin', u'Spectra', u'txt'],
- 306: [u"Heaven's Reach", u'David Brin', u'Spectra', u'lrf,rar'],
+ 306: [u"Heaven's Reach", u'David Brin', u'Spectra', u'lrf'],
  325: [u"Foundation's Triumph", u'David Brin', u'Easton Press', u'lit,lrf'],
  327: [u'I am Charlotte Simmons', u'Tom Wolfe', u'Vintage', u'htm,lrf'],
  335: [u'The Currents of Space', u'Isaac Asimov', None, u'lit,lrf'],
@@ -715,15 +715,15 @@ class Tester(SearchQueryParser):
        u'Aspect',
        u'lit,lrf'],
  356: [u'The Naked God', u'Peter F. Hamilton', u'Aspect', u'lit,lrf'],
- 421: [u'A Shadow in Summer', u'Daniel Abraham', u'Tor Fantasy', u'lrf,rar'],
+ 421: [u'A Shadow in Summer', u'Daniel Abraham', u'Tor Fantasy', u'lrf'],
  427: [u'Lonesome Dove', u'Larry M\\cMurtry', None, u'lit,lrf'],
  440: [u'Ghost', u'John Ringo', u'Baen', u'lit,lrf'],
  441: [u'Kildar', u'John Ringo', u'Baen', u'lit,lrf'],
- 443: [u'Hidden Empire ', u'Kevin J. Anderson', u'Aspect', u'lrf,rar'],
+ 443: [u'Hidden Empire ', u'Kevin J. Anderson', u'Aspect', u'lrf'],
  444: [u'The Gun Seller',
        u'Hugh Laurie',
        u'Washington Square Press',
-       u'lrf,rar']
+       u'lrf']
  }
 
     tests = {
diff --git a/src/calibre/web/feeds/feedparser.py b/src/calibre/web/feeds/feedparser.py
index 16085cf53..420efaa25 100755
--- a/src/calibre/web/feeds/feedparser.py
+++ b/src/calibre/web/feeds/feedparser.py
@@ -2081,7 +2081,7 @@ class _MicroformatsParser:
     EMAIL = 5
 
     known_xfn_relationships = set(['contact', 'acquaintance', 'friend', 'met', 'co-worker', 'coworker', 'colleague', 'co-resident', 'coresident', 'neighbor', 'child', 'parent', 'sibling', 'brother', 'sister', 'spouse', 'wife', 'husband', 'kin', 'relative', 'muse', 'crush', 'date', 'sweetheart', 'me'])
-    known_binary_extensions =  set(['zip','rar','exe','gz','tar','tgz','tbz2','bz2','z','7z','dmg','img','sit','sitx','hqx','deb','rpm','bz2','jar','rar','iso','bin','msi','mp2','mp3','ogg','ogm','mp4','m4v','m4a','avi','wma','wmv'])
+    known_binary_extensions =  set(['zip','exe','gz','tar','tgz','tbz2','bz2','z','7z','dmg','img','sit','sitx','hqx','deb','rpm','bz2','jar','iso','bin','msi','mp2','mp3','ogg','ogm','mp4','m4v','m4a','avi','wma','wmv'])
 
     def __init__(self, data, baseuri, encoding):
         self.document = BeautifulSoup.BeautifulSoup(data)
diff --git a/translations/calibre/main.pot b/translations/calibre/main.pot
index fc85e1b7a..87b62caf3 100644
--- a/translations/calibre/main.pot
+++ b/translations/calibre/main.pot
@@ -4424,7 +4424,7 @@ msgid "Set book ID"
 msgstr ""
 
 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/archive.py:44
-msgid "Extract common e-book formats from archives (zip/rar) files. Also try to autodetect if they are actually cbz/cbr files."
+msgid "Extract common e-book formats from archives (zip) files. Also try to autodetect if they are actually cbz files."
 msgstr ""
 
 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/book/base.py:655
@@ -12888,7 +12888,7 @@ msgid "You can also customise the plugin locations using <b>Preferences -> Custo
 msgstr ""
 
 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/comicconf.py:36
-msgid "Set defaults for conversion of comics (CBR/CBZ files)"
+msgid "Set defaults for conversion of comics (CBZ files)"
 msgstr ""
 
 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/comicconf.py:51
--- calibre-2.83.0/resources/images.qrc.orig	2017-04-13 00:02:36.000000000 -0300
+++ calibre-2.83.0/resources/images.qrc	2017-04-26 14:52:54.508461078 -0300
@@ -183,11 +183,9 @@
 <file>images/mimetypes/html.png</file>
 <file>images/mimetypes/xps.png</file>
 <file>images/mimetypes/svg.png</file>
-<file>images/mimetypes/cbr.png</file>
 <file>images/mimetypes/tpz.png</file>
 <file>images/mimetypes/snb.png</file>
 <file>images/mimetypes/png.png</file>
-<file>images/mimetypes/rar.png</file>
 <file>images/mimetypes/mobi.png</file>
 <file>images/mimetypes/gif.png</file>
 <file>images/mimetypes/pdf.png</file>
@@ -218,4 +216,4 @@
 <file>images/plugins/plugin_updater_updates.png</file>
 <file>images/plugins/plugin_upgrade_valid.png</file>
 </qresource>
-</RCC>
\ No hay ningún carácter de nueva línea al final del fichero
+</RCC>