summaryrefslogtreecommitdiff
path: root/libre/mcomix/libre.patch
blob: 916f46e6ce5c945b9dd74c73f357e4273196c5f7 (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
diff -Nur a/mcomix/about_dialog.py b/mcomix/about_dialog.py
--- a/mcomix/about_dialog.py	2014-07-20 14:41:41.000000000 -0300
+++ b/mcomix/about_dialog.py	2015-02-03 20:06:18.707598152 -0200
@@ -27,7 +27,7 @@
         comment = \
             _('%s is an image viewer specifically designed to handle comic books.') % \
             constants.APPNAME + u' ' + \
-            _('It reads ZIP, RAR and tar archives, as well as plain image files.')
+            _('It reads ZIP and tar archives, as well as plain image files.')
         self.set_comments(comment)
 
         license = \
diff -Nur a/mcomix/archive_tools.py b/mcomix/archive_tools.py
--- a/mcomix/archive_tools.py	2014-07-28 11:32:51.000000000 -0300
+++ b/mcomix/archive_tools.py	2015-02-03 20:10:46.137856205 -0200
@@ -11,7 +11,6 @@
 from mcomix import log
 from mcomix.archive import zip
 from mcomix.archive import zip_external
-from mcomix.archive import rar
 from mcomix.archive import tar
 from mcomix.archive import sevenzip
 from mcomix.archive import lha
@@ -20,9 +19,6 @@
 def szip_available():
     return sevenzip.SevenZipArchive.is_available()
 
-def rar_available():
-    return rar.RarArchive.is_available() or szip_available()
-
 def lha_available():
     return lha.LhaArchive.is_available() or szip_available()
 
@@ -35,9 +31,6 @@
     if szip_available():
         formats.extend(constants.SZIP_FORMATS[1])
 
-    if rar_available():
-        formats.extend(constants.RAR_FORMATS[1])
-
     if lha_available():
         formats.extend(constants.LHA_FORMATS[1])
 
@@ -81,10 +74,7 @@
                 else:
                     return constants.TAR
 
-            if magic[0:4] == 'Rar!':
-                return constants.RAR
-
-            elif magic[0:4] == '7z\xBC\xAF':
+            if magic[0:4] == '7z\xBC\xAF':
                 return constants.SEVENZIP
 
             # Headers for TAR-XZ and TAR-LZMA that aren't supported by tarfile
@@ -143,11 +133,6 @@
         return sevenzip.SevenZipArchive(path)
     elif type in (constants.TAR, constants.GZIP, constants.BZIP2):
         return tar.TarArchive(path)
-    elif type == constants.RAR and rar.RarArchive.is_available():
-        return rar.RarArchive(path)
-    elif type == constants.RAR and sevenzip.SevenZipArchive.is_available():
-        log.info('Using Sevenzip for RAR archives.')
-        return sevenzip.SevenZipArchive(path)
     elif type == constants.SEVENZIP and sevenzip.SevenZipArchive.is_available():
         return sevenzip.SevenZipArchive(path)
     elif type == constants.LHA and lha.LhaArchive.is_available():
diff -Nur a/mcomix/constants.py b/mcomix/constants.py
--- a/mcomix/constants.py	2015-01-31 06:06:26.000000000 -0200
+++ b/mcomix/constants.py	2015-02-03 20:11:54.983850230 -0200
@@ -41,7 +41,7 @@
 LAST_INDEX = -1
 UNION_INDEX = -2
 
-ZIP, RAR, TAR, GZIP, BZIP2, PDF, SEVENZIP, LHA, ZIP_EXTERNAL = range(9)
+ZIP, TAR, GZIP, BZIP2, PDF, SEVENZIP, LHA, ZIP_EXTERNAL = range(8)
 NORMAL_CURSOR, GRAB_CURSOR, WAIT_CURSOR, NO_CURSOR = range(4)
 LIBRARY_DRAG_EXTERNAL_ID, LIBRARY_DRAG_BOOK_ID, LIBRARY_DRAG_COLLECTION_ID = range(3)
 AUTOROTATE_NEVER, AUTOROTATE_WIDTH_90, AUTOROTATE_WIDTH_270, \
@@ -70,9 +70,6 @@
 ZIP_FORMATS = (
         ('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/x-cbz'),
         ('*.zip', '*.cbz'))
-RAR_FORMATS = (
-        ('application/x-rar', 'application/x-cbr'),
-        ('*.rar', '*.cbr'))
 TAR_FORMATS = (
         ('application/x-tar', 'application/x-gzip', 'application/x-bzip2', 'application/x-cbt'),
         ('*.tar', '*.gz', '*.bz2', '*.bzip2', '*.cbt'))
diff -Nur a/mcomix/file_chooser_base_dialog.py b/mcomix/file_chooser_base_dialog.py
--- a/mcomix/file_chooser_base_dialog.py	2014-01-18 06:01:42.000000000 -0200
+++ b/mcomix/file_chooser_base_dialog.py	2015-02-03 20:13:45.971467307 -0200
@@ -88,9 +88,6 @@
         # extractor availability.
         mimetypes = constants.ZIP_FORMATS[0] + constants.TAR_FORMATS[0]
         patterns = constants.ZIP_FORMATS[1] + constants.TAR_FORMATS[1]
-        if archive_tools.rar_available():
-            mimetypes += constants.RAR_FORMATS[0]
-            patterns += constants.RAR_FORMATS[1]
         if archive_tools.szip_available():
             mimetypes += constants.SZIP_FORMATS[0]
             patterns += constants.SZIP_FORMATS[1]
@@ -107,10 +104,6 @@
         self.add_filter(_('Tar archives'),
             *constants.TAR_FORMATS)
 
-        if archive_tools.rar_available():
-            self.add_filter(_('RAR archives'),
-                *constants.RAR_FORMATS)
-
         if archive_tools.szip_available():
             self.add_filter(_('7z archives'),
                 *constants.SZIP_FORMATS)
diff -Nur a/mcomix/messages/mcomix.pot b/mcomix/messages/mcomix.pot
--- a/mcomix/messages/mcomix.pot	2015-01-31 05:55:44.000000000 -0200
+++ b/mcomix/messages/mcomix.pot	2015-02-03 20:32:26.271598749 -0200
@@ -24,7 +24,7 @@
 msgstr ""
 
 #: mcomix/about_dialog.py:30
-msgid "It reads ZIP, RAR and tar archives, as well as plain image files."
+msgid "It reads ZIP and tar archives, as well as plain image files."
 msgstr ""
 
 #: mcomix/about_dialog.py:34
@@ -242,10 +242,6 @@
 msgid "Tar archives"
 msgstr ""
 
-#: mcomix/file_chooser_base_dialog.py:111
-msgid "RAR archives"
-msgstr ""
-
 #: mcomix/file_chooser_base_dialog.py:115
 msgid "7z archives"
 msgstr ""
@@ -1568,10 +1564,6 @@
 msgid "Bzip2 compressed tar archive"
 msgstr ""
 
-#: mcomix/strings.py:13
-msgid "RAR archive"
-msgstr ""
-
 #: mcomix/strings.py:14
 msgid "7z archive"
 msgstr ""
diff -Nur a/mcomix/process.py b/mcomix/process.py
--- a/mcomix/process.py	2014-07-25 13:37:00.000000000 -0300
+++ b/mcomix/process.py	2015-02-03 20:16:10.747046736 -0200
@@ -20,10 +20,7 @@
 class Process:
 
     """The subprocess and popen2 modules in Python are broken (see issue
-    #1336). The problem (i.e. complete crash) they can cause happen fairly
-    often (once is too often) in MComix when calling "rar" or "unrar" to
-    extract specific files from archives. We roll our own very simple
-    process spawning module here instead.
+    #1336). We roll our own very simple process spawning module here instead.
     """
     # TODO: I can no longer reproduce the issue. Check if this version of
     # process.py still solves it.
diff -Nur a/mcomix/recent.py b/mcomix/recent.py
--- a/mcomix/recent.py	2014-06-09 03:08:26.000000000 -0300
+++ b/mcomix/recent.py	2015-02-03 20:17:14.779514387 -0200
@@ -31,8 +31,7 @@
         rfilter.add_pixbuf_formats()
 
         mimetypes, patterns = itertools.izip(constants.ZIP_FORMATS,
-                constants.RAR_FORMATS, constants.TAR_FORMATS,
-                constants.SZIP_FORMATS)
+                constants.TAR_FORMATS, constants.SZIP_FORMATS)
 
         for mimetype in itertools.chain.from_iterable(mimetypes):
             rfilter.add_mime_type(mimetype)
diff -Nur a/mcomix/strings.py b/mcomix/strings.py
--- a/mcomix/strings.py	2014-01-18 06:01:42.000000000 -0200
+++ b/mcomix/strings.py	2015-02-03 20:18:10.421674128 -0200
@@ -3,14 +3,13 @@
     This file should only be imported after gettext has been correctly initialized
     and installed in the global namespace. """
 
-from mcomix.constants import ZIP, TAR, GZIP, BZIP2, RAR, SEVENZIP, LHA
+from mcomix.constants import ZIP, TAR, GZIP, BZIP2, SEVENZIP, LHA
 
 ARCHIVE_DESCRIPTIONS = {
                         ZIP:   _('ZIP archive'),
                         TAR:   _('Tar archive'),
                         GZIP:  _('Gzip compressed tar archive'),
                         BZIP2: _('Bzip2 compressed tar archive'),
-                        RAR:   _('RAR archive'),
                         SEVENZIP: _('7z archive'),
                         LHA: _('LHA archive')
                        }
diff -Nur a/mcomix.egg-info/SOURCES.txt b/mcomix.egg-info/SOURCES.txt
--- a/mcomix.egg-info/SOURCES.txt	2015-01-31 06:08:19.000000000 -0200
+++ b/mcomix.egg-info/SOURCES.txt	2015-02-03 20:19:25.537920559 -0200
@@ -84,8 +84,6 @@
 mcomix/archive/archive_recursive.py
 mcomix/archive/lha.py
 mcomix/archive/pdf.py
-mcomix/archive/rar.py
-mcomix/archive/rarfile.py
 mcomix/archive/sevenzip.py
 mcomix/archive/tar.py
 mcomix/archive/zip.py
@@ -184,18 +182,13 @@
 mime/mcomix.desktop
 mime/mcomix.thumbnailer
 mime/mcomix.xml
-mime/icons/16x16/application-x-cbr.png
 mime/icons/16x16/application-x-cbt.png
 mime/icons/16x16/application-x-cbz.png
-mime/icons/22x22/application-x-cbr.png
 mime/icons/22x22/application-x-cbt.png
 mime/icons/22x22/application-x-cbz.png
-mime/icons/24x24/application-x-cbr.png
 mime/icons/24x24/application-x-cbt.png
 mime/icons/24x24/application-x-cbz.png
-mime/icons/32x32/application-x-cbr.png
 mime/icons/32x32/application-x-cbt.png
 mime/icons/32x32/application-x-cbz.png
-mime/icons/48x48/application-x-cbr.png
 mime/icons/48x48/application-x-cbt.png
-mime/icons/48x48/application-x-cbz.png
\ No newline at end of file
+mime/icons/48x48/application-x-cbz.png
diff -Nur a/mime/comicbook.schemas b/mime/comicbook.schemas
--- a/mime/comicbook.schemas	2013-01-08 14:26:46.000000000 -0200
+++ b/mime/comicbook.schemas	2015-02-03 20:20:10.809688373 -0200
@@ -1,28 +1,6 @@
 <gconfschemafile>
     <schemalist>
         <schema>
-            <key>/schemas/desktop/gnome/thumbnailers/application@x-cbr/enable</key>
-            <applyto>/desktop/gnome/thumbnailers/application@x-cbr/enable</applyto>
-            <owner>comicthumb</owner>
-            <type>bool</type>
-            <default>true</default>
-            <locale name="C">
-                <short></short>
-                <long></long>
-            </locale>
-        </schema>
-        <schema>
-            <key>/schemas/desktop/gnome/thumbnailers/application@x-cbr/command</key>
-            <applyto>/desktop/gnome/thumbnailers/application@x-cbr/command</applyto>
-            <owner>comicthumb</owner>
-            <type>string</type>
-            <default>comicthumb %i %o %s</default>
-            <locale name="C">
-                <short></short>
-                <long></long>
-            </locale>
-        </schema>
-        <schema>
             <key>/schemas/desktop/gnome/thumbnailers/application@x-cbz/enable</key>
             <applyto>/desktop/gnome/thumbnailers/application@x-cbz/enable</applyto>
             <owner>comicthumb</owner>
diff -Nur a/mime/comicthumb b/mime/comicthumb
--- a/mime/comicthumb	2013-01-13 14:35:00.000000000 -0200
+++ b/mime/comicthumb	2015-02-03 20:22:30.481808283 -0200
@@ -7,7 +7,7 @@
 comicthumb was originally written by Christoph Wolk, this version was
 re-written from scratch for Comix 4 by Pontus Ekberg. 
 
-Supported formats: ZIP, RAR and tar (.cbz, .cbr, .cbt)
+Supported formats: ZIP and tar (.cbz, .cbt)
 
 Usage: comicthumb INFILE OUTFILE [SIZE]
 """
@@ -28,16 +28,13 @@
     print __doc__
     sys.exit(1)
 
-ZIP, RAR, TAR, GZIP, BZIP2 = range(5)
+ZIP, TAR, GZIP, BZIP2 = range(5)
 
 
 class Process:
     
     """The subprocess and popen2 modules in Python are broken (see issue
-    #1336). The problem (i.e. complete crash) they can cause happen fairly
-    often (once is too often) in Comix when calling "rar" or "unrar" to
-    extract specific files from archives. We roll our own very simple
-    process spawning module here instead.
+    #1336). We roll our own very simple process spawning module here instead.
     """
     # TODO: I can no longer reproduce the issue. Check if this version of
     # process.py still solves it.
@@ -94,19 +91,6 @@
         elif self._type in [TAR, GZIP, BZIP2]:
             self._tfile = tarfile.open(src, 'r')
             self._files = self._tfile.getnames()
-        elif self._type == RAR:
-            self._rar = None
-            for command in ('unrar', 'rar'):
-                if Process([command]).spawn() is not None:
-                    self._rar = command
-            if self._rar == None:
-                print '! Could not find the "rar" or "unrar" executable.'
-                sys.exit(1)
-            proc = Process([self._rar, 'vb', src])
-            fobj = proc.spawn()
-            self._files = fobj.readlines()
-            proc.wait()
-            self._files = [name.rstrip('\n') for name in self._files]
     
     def get_files(self):
         """Return a list of the files in the archive."""
@@ -121,11 +105,6 @@
             return cStringIO.StringIO(self._zfile.read(chosen))
         elif self._type in [TAR, GZIP, BZIP2]:
             return cStringIO.StringIO(self._tfile.extractfile(chosen).read())
-        elif self._type == RAR:
-            proc = Process([self._rar, 'p', '-inul', '-p-', '--',
-                self._src, chosen])
-            fobj = proc.spawn()
-            return cStringIO.StringIO(fobj.read())
 
 
 def archive_mime_type(path):
@@ -145,8 +124,6 @@
                 if magic.startswith('\037\213'):
                     return GZIP
                 return TAR
-            if magic == 'Rar!':
-                return RAR
     except Exception:
         print '! Error while reading', path
     return None
diff -Nur a/mime/mcomix.desktop b/mime/mcomix.desktop
--- a/mime/mcomix.desktop	2013-01-08 14:26:46.000000000 -0200
+++ b/mime/mcomix.desktop	2015-02-03 20:24:12.805803236 -0200
@@ -19,4 +19,4 @@
 Type=Application
 StartupNotify=true
 Categories=Graphics;Viewer;
-MimeType=application/x-cbz;application/x-cbr;application/x-cbt;image/jpeg;image/png;image/gif;image/tiff;image/bmp;image/x-icon;image/x-xpixmap;image/x-xbitmap;application/x-zip;application/zip;application/x-rar;application/x-tar;application/x-gzip;application/x-bzip2;image/svg+xml;image/svg;image/svg-xml;image/vnd.adobe.svg+xml;text/xml-svg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-pcx;image/x-cmu-raster;image/x-sun-raster;image/x-tga;application/x-7z-compressed;application/x-cb7;application/x-lzh;application/x-lha;application/x-lzh-compressed;
+MimeType=application/x-cbz;application/x-cbt;image/jpeg;image/png;image/gif;image/tiff;image/bmp;image/x-icon;image/x-xpixmap;image/x-xbitmap;application/x-zip;application/zip;application/x-tar;application/x-gzip;application/x-bzip2;image/svg+xml;image/svg;image/svg-xml;image/vnd.adobe.svg+xml;text/xml-svg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-pcx;image/x-cmu-raster;image/x-sun-raster;image/x-tga;application/x-7z-compressed;application/x-cb7;application/x-lzh;application/x-lha;application/x-lzh-compressed;
diff -Nur a/mime/mcomix.thumbnailer b/mime/mcomix.thumbnailer
--- a/mime/mcomix.thumbnailer	2014-01-18 06:01:42.000000000 -0200
+++ b/mime/mcomix.thumbnailer	2015-02-03 20:27:12.596127651 -0200
@@ -1,4 +1,4 @@
 [Thumbnailer Entry]
 TryExec=comicthumb
 Exec=comicthumb %u %o %s
-MimeType=application/x-cbr;application/x-cbz;application/x-cbt;
+MimeType=application/x-cbz;application/x-cbt;
diff -Nur a/mime/mcomix.xml b/mime/mcomix.xml
--- a/mime/mcomix.xml	2013-01-08 14:26:46.000000000 -0200
+++ b/mime/mcomix.xml	2015-02-03 20:27:36.940405337 -0200
@@ -5,11 +5,6 @@
         <comment xml:lang="en">Comic Book Archive (Zip compressed)</comment>
         <glob pattern="*.cbz"/>
     </mime-type>
-    <mime-type type="application/x-cbr">
-        <sub-class-of type="application/x-rar"/>
-        <comment xml:lang="en">Comic Book Archive (RAR compressed)</comment>
-        <glob pattern="*.cbr"/> 
-    </mime-type>
     <mime-type type="application/x-cbt">
         <sub-class-of type="application/x-compressed-tar"/>
         <sub-class-of type="application/x-bzip-compressed-tar"/>
diff -Nur a/setup.py b/setup.py
--- a/setup.py	2014-06-09 03:08:26.000000000 -0300
+++ b/setup.py	2015-02-03 20:28:30.005795579 -0200
@@ -79,23 +79,18 @@
         ('share/icons/hicolor/48x48/apps', ['mcomix/images/48x48/mcomix.png']),
         ('share/icons/hicolor/16x16/mimetypes',
             ['mime/icons/16x16/application-x-cbz.png',
-             'mime/icons/16x16/application-x-cbr.png',
              'mime/icons/16x16/application-x-cbt.png']),
         ('share/icons/hicolor/22x22/mimetypes',
             ['mime/icons/22x22/application-x-cbz.png',
-             'mime/icons/22x22/application-x-cbr.png',
              'mime/icons/22x22/application-x-cbt.png']),
         ('share/icons/hicolor/24x24/mimetypes',
             ['mime/icons/24x24/application-x-cbz.png',
-             'mime/icons/24x24/application-x-cbr.png',
              'mime/icons/24x24/application-x-cbt.png']),
         ('share/icons/hicolor/32x32/mimetypes',
             ['mime/icons/32x32/application-x-cbz.png',
-             'mime/icons/32x32/application-x-cbr.png',
              'mime/icons/32x32/application-x-cbt.png']),
         ('share/icons/hicolor/48x48/mimetypes',
             ['mime/icons/48x48/application-x-cbz.png',
-             'mime/icons/48x48/application-x-cbr.png',
              'mime/icons/48x48/application-x-cbt.png'])],
 
     # Package metadata