summaryrefslogtreecommitdiff
path: root/libre/xarchiver-libre/xarchiver-0.5.3-add-unar-support.patch
blob: 0b54cacc19887cd700e05c5bedaa7bdae32694d5 (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
diff -Nur xarchiver-0.5.3.orig/doc/html/ch03s03.html xarchiver-0.5.3/doc/html/ch03s03.html
--- xarchiver-0.5.3.orig/doc/html/ch03s03.html	2008-11-03 04:49:49.000000000 -0200
+++ xarchiver-0.5.3/doc/html/ch03s03.html	2014-02-20 04:35:34.820373529 -0200
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>General</title><link rel="stylesheet" href="xarchiver.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.71.0" /><link rel="start" href="index.html" title="Xarchiver 0.5" /><link rel="up" href="ch03.html" title="Chapter 3. Usage" /><link rel="prev" href="ch03s02.html" title="Command line options" /><link rel="next" href="ch03s04.html" title="Xarchiver menu" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">General</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Usage</th><td width="20%" align="right"> <a accesskey="n" href="ch03s04.html">Next</a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="general"></a>General</h2></div></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="general_startup"></a>Startup</h3></div></div></div><p>
-					At startup, Xarchiver detects the available installed archivers (tar,rar,zip etc) and the script <i>xdg-open</i> for handling different file types. Since Xarchiver is a frontend (a graphic user interface to the cmd-line executables) it can't create archives whose archiver is not available. For instance if you have the free edition of rar, unrar, Xarchiver can't create rar archives since unrar allows rar archives to be opened, tested and extracted but not to be created.
+					At startup, Xarchiver detects the available installed archivers (tar,rar,zip etc) and the script <i>xdg-open</i> for handling different file types. Since Xarchiver is a frontend (a graphic user interface to the cmd-line executables) it can't create archives whose archiver is not available. For instance if you have the free as in freedom alternative of rar, unar, Xarchiver can't create rar archives since unar allows rar archives to be opened, tested and extracted but not to be created.
 				</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="how_it_works"></a>How it works</h3></div></div></div><p>
 					Xarchiver will run in the background the cmd-line executable of the archiver with the archiver's proper switches to perform the selected operation. If something goes wrong Xarchiver reports the full output of the archiver executable in the command line output window. From the release 0.5 the files in the archive can be opened within Xarchiver. The script <i>xdg-open</i> will detect the file type and run the proper application to handle it. If you don't have such script installed in your system (it's found in the xdg-utils package) Xarchiver will recognize HTML, txt and images files only. The Preferences dialog will notify this to you when you click the Advanced section inside it.
 				</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="dnd"></a>Drag and Drop</h3></div></div></div><p>
diff -Nur xarchiver-0.5.3.orig/doc/xarchiver.docbook xarchiver-0.5.3/doc/xarchiver.docbook
--- xarchiver-0.5.3.orig/doc/xarchiver.docbook	2007-08-22 07:49:19.000000000 -0300
+++ xarchiver-0.5.3/doc/xarchiver.docbook	2014-02-20 04:35:34.820373529 -0200
@@ -204,7 +204,7 @@
 			<section id="general_startup">
 				<title>Startup</title>
 				<para>
-					At startup, &app; detects the available installed archivers (tar,rar,zip etc). Since Xarchiver is a frontend (a graphic user interface to the cmd-line executables) it can't create archives whose archiver is not available. For instance if you have the free edition of rar, unrar, Xarchiver can't create rar archives since unrar allows rar archives to be opened, tested and extracted but not to be created.
+					At startup, &app; detects the available installed archivers (tar,rar,zip etc). Since Xarchiver is a frontend (a graphic user interface to the cmd-line executables) it can't create archives whose archiver is not available. For instance if you have the free as in freedom alternative of rar, unar, Xarchiver can't create rar archives since unar allows rar archives to be opened and extracted but not to be created.
 				</para>
 			</section>
 			<section id="how_it_works">
diff -Nur xarchiver-0.5.3.orig/src/interface.c xarchiver-0.5.3/src/interface.c
--- xarchiver-0.5.3.orig/src/interface.c	2014-02-09 13:26:24.000000000 -0200
+++ xarchiver-0.5.3/src/interface.c	2014-02-20 04:58:54.470139199 -0200
@@ -45,7 +45,7 @@
   { "text/uri-list",0,0 },
 };
 
-extern gboolean unrar,batch_mode;
+extern gboolean unar,batch_mode;
 
 static gboolean xa_progress_dialog_delete_event (GtkWidget *caller,GdkEvent *event,GPid pid);
 static void xa_progress_dialog_stop_action (GtkWidget *widget,GPid pid);
@@ -623,7 +623,7 @@
 		{
 			gtk_widget_show(selected_frame);
 			gtk_widget_set_sensitive(deselect_all,TRUE);
-			if ((archive[id]->type == XARCHIVETYPE_RAR || archive[id]->type == XARCHIVETYPE_RAR5) && unrar)
+			if ((archive[id]->type == XARCHIVETYPE_RAR) && unar)
 			{
 				gtk_widget_set_sensitive (delete_menu,FALSE);
 				gtk_widget_set_sensitive (rename_menu,FALSE);
diff -Nur xarchiver-0.5.3.orig/src/main.c xarchiver-0.5.3/src/main.c
--- xarchiver-0.5.3.orig/src/main.c	2014-02-20 03:24:20.406301116 -0200
+++ xarchiver-0.5.3/src/main.c	2014-02-20 04:43:27.247666292 -0200
@@ -33,7 +33,7 @@
 gchar *add_files;
 gboolean error_output, file_to_open, ask_and_extract, ask_and_add, multi_extract;
 gboolean batch_mode = FALSE;
-gboolean unrar = FALSE;
+gboolean unar = FALSE;
 gboolean sevenzr = FALSE, sevenza = FALSE, xdg_open = FALSE;
 static gboolean show_version = FALSE;
 int response;
@@ -330,7 +330,6 @@
 	delete[XARCHIVETYPE_GZIP]  = 0;
 	delete[XARCHIVETYPE_LZMA]  = 0;
 	delete[XARCHIVETYPE_XZ]  = 0;
-	delete[XARCHIVETYPE_RAR]  = delete[XARCHIVETYPE_RAR5]  = &xa_rar_delete;
 	delete[XARCHIVETYPE_RPM]  = 0;
 	delete[XARCHIVETYPE_TAR]  = delete[XARCHIVETYPE_TAR_BZ2] = delete[XARCHIVETYPE_TAR_GZ] = delete[XARCHIVETYPE_TAR_LZMA] = delete[XARCHIVETYPE_TAR_XZ] = delete[XARCHIVETYPE_TAR_LZOP] = &xa_tar_delete;
 	delete[XARCHIVETYPE_ZIP] = &xa_zip_delete;
@@ -343,7 +342,6 @@
 	add[XARCHIVETYPE_ARJ]  = &xa_arj_add;
 	add[XARCHIVETYPE_DEB]  = 0;
 	add[XARCHIVETYPE_BZIP2]  = add[XARCHIVETYPE_GZIP] = add[XARCHIVETYPE_LZMA] = add[XARCHIVETYPE_XZ] = add[XARCHIVETYPE_LZOP] = &xa_tar_add;
-	add[XARCHIVETYPE_RAR]  = add[XARCHIVETYPE_RAR5]  = &xa_rar_add;
 	add[XARCHIVETYPE_RPM]  = 0;
 	add[XARCHIVETYPE_TAR]  = add[XARCHIVETYPE_TAR_BZ2] = add[XARCHIVETYPE_TAR_GZ] = add[XARCHIVETYPE_TAR_LZMA] = add[XARCHIVETYPE_TAR_XZ] = add[XARCHIVETYPE_TAR_LZOP] = &xa_tar_add;
 	add[XARCHIVETYPE_ZIP] = &xa_zip_add;
@@ -364,7 +362,6 @@
 	test[XARCHIVETYPE_7ZIP]  = &xa_7zip_test;
 	test[XARCHIVETYPE_ARJ]  = &xa_arj_test;
 	test[XARCHIVETYPE_DEB]  = test[XARCHIVETYPE_BZIP2] = test[XARCHIVETYPE_GZIP] = test[XARCHIVETYPE_LZMA] = test[XARCHIVETYPE_XZ] = test[XARCHIVETYPE_LZOP] = &xa_tar_test;
-	test[XARCHIVETYPE_RAR]  = test[XARCHIVETYPE_RAR5]  = &xa_rar_test;
 	test[XARCHIVETYPE_RPM]  = 0;
 	test[XARCHIVETYPE_TAR]  = test[XARCHIVETYPE_TAR_BZ2] = test[XARCHIVETYPE_TAR_GZ] = test[XARCHIVETYPE_TAR_LZMA] = test[XARCHIVETYPE_TAR_XZ] = test[XARCHIVETYPE_TAR_LZOP] =  &xa_tar_test;
 	test[XARCHIVETYPE_ZIP] = &xa_zip_test;
@@ -435,38 +432,14 @@
 		//ArchiveSuffix = g_list_append(ArchiveSuffix, "");
 	}
 
-	absolute_path = g_find_program_in_path ("rar");
+	absolute_path = g_find_program_in_path ("unar");
     if ( absolute_path )
 	{
+		unar = TRUE;
 		ArchiveType = g_list_append(ArchiveType, "rar");
 		ArchiveSuffix = g_list_append(ArchiveSuffix, "*.rar");
-		// Is RAR v5 ?
-		xa_rar_checkversion (absolute_path);
-		if (rar_version == 5)
-		{
-			ArchiveType = g_list_append(ArchiveType, "rar5");
-			ArchiveSuffix = g_list_append(ArchiveSuffix, "*.rar5");	
-		}
 		g_free (absolute_path);
 	}
-	else
-	{
-		absolute_path = g_find_program_in_path("unrar");
-		if ( absolute_path )
-		{
-			unrar = TRUE;
-			ArchiveType = g_list_append(ArchiveType, "rar");
-			ArchiveSuffix = g_list_append(ArchiveSuffix, "*.rar");
-			// Is RAR v5 ?
-			xa_rar_checkversion (absolute_path);
-			if (rar_version == 5)
-			{
-				ArchiveType = g_list_append(ArchiveType, "rar5");
-				ArchiveSuffix = g_list_append(ArchiveSuffix, "*.rar5");	
-			}
-			g_free (absolute_path);
-		}
-	}
 
 	absolute_path = g_find_program_in_path("cpio");
     if ( absolute_path )
diff -Nur xarchiver-0.5.3.orig/src/new_dialog.c xarchiver-0.5.3/src/new_dialog.c
--- xarchiver-0.5.3.orig/src/new_dialog.c	2014-02-09 13:26:24.000000000 -0200
+++ xarchiver-0.5.3/src/new_dialog.c	2014-02-20 05:13:00.058263839 -0200
@@ -24,7 +24,7 @@
 #include "string_utils.h"
 #include "main.h"
 
-extern gboolean unrar;
+extern gboolean unar;
 extern Prefs_dialog_data *prefs_window;
 gchar *current_new_directory = NULL;
 gint  new_combo_box = -1;
@@ -101,7 +101,7 @@
 
 	while (Name)
 	{
-		if (!(strncmp(Name->data, "rar", 3) == 0 && unrar))
+		if (!(strncmp(Name->data, "rar", 3) == 0 && unar))
 			gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box),Name->data);
 		Name = g_list_next (Name);
 	}
diff -Nur xarchiver-0.5.3.orig/src/pref_dialog.c xarchiver-0.5.3/src/pref_dialog.c
--- xarchiver-0.5.3.orig/src/pref_dialog.c	2014-02-09 13:26:24.000000000 -0200
+++ xarchiver-0.5.3/src/pref_dialog.c	2014-02-20 04:44:40.225947167 -0200
@@ -23,7 +23,7 @@
 #include "main.h"
 #include "support.h"
 
-extern gboolean unrar;
+extern gboolean unar;
 extern gboolean xdg_open;
 extern Extract_dialog_data *extract_window;
 extern Add_dialog_data *add_window;
@@ -104,7 +104,7 @@
 	{
 		if (strcmp(archive_type->data, "tgz") == 0 ||
 			strcmp(archive_type->data, "rpm") == 0 ||
-			(strncmp(archive_type->data, "rar", 3) == 0 && unrar) )
+			(strncmp(archive_type->data, "rar", 3) == 0 && unar) )
 			goto next;
 		else
 			gtk_combo_box_append_text (GTK_COMBO_BOX (prefs_data->combo_prefered_format),archive_type->data );
diff -Nur xarchiver-0.5.3.orig/src/rar.c xarchiver-0.5.3/src/rar.c
--- xarchiver-0.5.3.orig/src/rar.c	2014-02-09 13:26:24.000000000 -0200
+++ xarchiver-0.5.3/src/rar.c	2014-02-20 05:11:19.611884642 -0200
@@ -20,7 +20,7 @@
 #include "rar.h"
 #include <unistd.h>
 
-extern gboolean unrar;
+extern gboolean unar;
 extern void xa_reload_archive_content(XArchive *archive);
 extern void xa_create_liststore ( XArchive *archive, gchar *columns_names[]);
 extern int rar_version;
@@ -36,44 +36,15 @@
 	gchar *command = NULL;
 	gchar *rar = NULL;
 	jump_header = read_filename = last_line = encrypted = FALSE;
-		
-	if (unrar)
-	{
-		rar = "unrar";
-		archive->can_add = archive->has_sfx = FALSE;
-	}
-	else
-	{
-		rar = "rar";
-		archive->can_add = archive->has_sfx = TRUE;
-	}
+	rar = "unar";
+	archive->can_add = archive->has_sfx = FALSE;
 
-	command = g_strconcat ( rar," v " , archive->escaped_path, NULL );
+	command = g_strconcat ( rar, archive->escaped_path, NULL );
 	archive->has_sfx = archive->has_properties = archive->can_extract = archive->has_test = TRUE;
 	archive->dummy_size = 0;
     archive->nr_of_files = 0;
     
-    if (archive->type == XARCHIVETYPE_RAR5)
-		archive->format = "RAR5";
-	else
-		archive->format = "RAR";
-
-		
-	if (rar_version == 5)
-	{
-		archive->nc = 8;
-		archive->parse_output = xa_get_rar5_line_content;
-		xa_spawn_async_process (archive,command);
-		g_free ( command );
-		if ( archive->child_pid == 0 )
-			return;
-		archive->column_types = g_malloc0(sizeof(types5));
-		for (i = 0; i < archive->nc+2; i++)
-			archive->column_types[i] = types5[i];
-			
-		xa_create_liststore (archive, names5);
-	}
-	else
+	archive->format = "RAR";
 	{
 		archive->nc = 10;
 		archive->parse_output = xa_get_rar_line_content;
@@ -247,32 +218,6 @@
 	}
 }
 
-void xa_rar_delete (XArchive *archive,GSList *names)
-{
-	gchar *command,*e_filename = NULL;
-	GSList *list = NULL,*_names;
-	GString *files = g_string_new("");
-
- 	_names = names;
- 	while (_names)
-	{
-		e_filename  = xa_escape_filename((gchar*)_names->data,"$'`\"\\!?* ()[]&|:;<>#");
-		g_string_prepend (files,e_filename);
-		g_string_prepend_c (files,' ');
-		_names = _names->next;
-	}
-	g_slist_foreach(names,(GFunc)g_free,NULL);
-	g_slist_free(names);
-	
-	command = g_strconcat ("rar d ",archive->escaped_path," ",files->str,NULL);
-	g_string_free(files,TRUE);
-	list = g_slist_append(list,command);
-
-	xa_run_command (archive,list);
-	if (archive->status == XA_ARCHIVESTATUS_DELETE)
-		xa_reload_archive_content(archive);
-}
-
 gboolean xa_rar_extract(XArchive *archive,GSList *files)
 {
 	gchar *rar, *command, *e_filename = NULL;
@@ -281,10 +226,7 @@
 	gboolean result = FALSE;
 
 	_files = files;
-	if (unrar)
-		rar = "unrar";
-	else
-		rar = "rar";
+	rar = "unar";
 
 	while (_files)
 	{
@@ -315,230 +257,3 @@
 	result = xa_run_command (archive,list);
 	return result;
 }
-
-void xa_rar_test (XArchive *archive)
-{
-	gchar *rar = NULL;
-	gchar *command = NULL;
-	GSList *list = NULL;
-
-	if (unrar)
-		rar = "unrar";
-	else
-		rar = "rar";
-
-	archive->status = XA_ARCHIVESTATUS_TEST;
-	if (archive->passwd != NULL)
-		command = g_strconcat (rar," t -idp -p" , archive->passwd ," " , archive->escaped_path, NULL);
-	else
-		command = g_strconcat (rar," t -idp " , archive->escaped_path, NULL);
-
-	list = g_slist_append(list,command);
-	xa_run_command (archive,list);
- }
-
-void xa_get_rar5_line_content (gchar *line, gpointer data)
-{
-	XArchive *archive = data;
-	XEntry *entry;
-	gpointer item[7];
-	unsigned short int i = 0;
-	unsigned int linesize,n,a;
-	gboolean dir = FALSE;
-	static gchar *filename;
-
-	if (last_line)
-		return;
-
-	if (jump_header == FALSE)
-	{
-		if (strncmp(line,"Comment:",8) == 0)
-		{
-			jump_comment = archive->has_comment = TRUE;
-			archive->comment = g_string_new("");
-			archive->comment = g_string_append(archive->comment,&line[9]);
-			return;
-		}
-		if (jump_comment == TRUE)
-		{
-			if (strncmp(line,"Name",4) != 0)
-			{	archive->comment = g_string_append(archive->comment,line);
-				return;
-			}
-			jump_comment = FALSE;
-		}
-		if (line[0] == '-')
-		{
-			jump_header = TRUE;
-			return;
-		}
-		return;
-	}
-
-	linesize = strlen(line);
-	line[linesize - 1] = '\0';
-
-	if(line[0] == '*')
-	{
-		archive->has_passwd = TRUE;
-		encrypted = TRUE;
-	}
-	else if (line[0] == '-')
-	{
-		last_line = TRUE;
-		return;
-	}
-
-	archive->nr_of_files++;
-
-	/* Permissions */
-	for(n=0; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n] = '\0';
-	if ((line+a)[0] == 'd')
-		dir = TRUE;
-	item[5] = line + a;
-	n++;
-
-	/* Size */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n]='\0';
-	item[i] = line + a;
-	archive->dummy_size += g_ascii_strtoull(item[i],NULL,0);
-	i++;
-	n++;
-	
-	/* Compressed */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n]='\0';
-	item[i] = line + a;
-	i++;
-	n++;
-
-	/* Ratio */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n] = '\0';
-	item[i] = line + a;
-	i++;
-	n++;
-
-	/* Date */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n] = '\0';
-	item[i] = line + a;
-	i++;
-	n++;
-
-	/* Time */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n] = '\0';
-	item[i] = line + a;
-	i+=2;
-	n++;
-	
-	/* CRC */
-	for(; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' '; n++);
-	line[n] = '\0';
-	item[i] = line + a;
-	i++;
-	n++;
-	
-	/* fileName */
-	for(n=64; n < linesize && line[n] == ' '; n++);
-	a = n;
-	for(; n < linesize && line[n] != ' ' && line[n] != '\n'; n++);
-	line[n]='\0';
-	filename = g_strdup(line + a);
-	
-	/* Work around for rar which doesn't
-	 * output / with directories */
-	if (dir)
-	{
-		gchar *filename_with_slash = g_strconcat (filename,"/",NULL);
-		g_free (filename);
-		filename = filename_with_slash;
-	}
-
-	entry = xa_set_archive_entries_for_each_row (archive,filename,item);
-	if (entry != NULL)
-		entry->is_encrypted = encrypted;
-	g_free(filename);
-	encrypted = FALSE;
-}
-
-void xa_rar_add (XArchive *archive,GString *files,gchar *compression_string)
-{
-	GSList *list = NULL;
-	gchar *command, *rar_version = NULL;
-	
-
-	if (archive->location_entry_path != NULL)
-		archive->working_dir = g_strdup(archive->tmp);
-	
-	if (archive->type == XARCHIVETYPE_RAR5)
-		rar_version = "5";
-	else
-		rar_version = "4";
-
-	if (compression_string == NULL)
-		compression_string = "3";
-		
-	if (archive->passwd != NULL)
-		command = g_strconcat ( "rar a -ma", rar_version, " ",
-									archive->update ? "-u " : "",
-									archive->freshen ? "-f " : "",
-									archive->solid_archive ? "-s " : "",
-									archive->remove_files ? "-df " : "",
-									"-p" , archive->passwd,
-									" -idp ",
-									"-m",compression_string," ",
-									archive->escaped_path,
-									files->str,NULL);
-	else
-		command = g_strconcat ( "rar a -ma", rar_version, " ",
-									archive->update ? "-u " : "",
-									archive->freshen ? "-f " : "",
-									archive->solid_archive ? "-s " : " ",
-									archive->remove_files ? "-df " : " ",
-									"-idp ",
-									"-m",compression_string," ",
-									archive->escaped_path,
-									files->str,NULL);
-
-	g_string_free(files,TRUE);
-	list = g_slist_append(list,command);
-
-	xa_run_command (archive,list);
-	xa_reload_archive_content(archive);
-}
-
-int xa_rar_checkversion (gchar *absolute_path)
-{
-	//gchar *command;
-	gchar *output = NULL;
-
-	rar_version = 4;  // Default version
-	
-	//command = g_strconcat (absolute_path, "" , NULL);
-	g_spawn_command_line_sync (absolute_path, &output, NULL, NULL, NULL);
-	
-	if (g_ascii_strncasecmp ("\nRAR 5", output, 6) == 0 || g_ascii_strncasecmp ("\nUNRAR 5", output, 8) == 0)
-			rar_version = 5;
-	
-	g_free(output);
-	//g_free(command);
-	return rar_version;
-}
diff -Nur xarchiver-0.5.3.orig/src/rar.h xarchiver-0.5.3/src/rar.h
--- xarchiver-0.5.3.orig/src/rar.h	2014-02-09 13:26:24.000000000 -0200
+++ xarchiver-0.5.3/src/rar.h	2014-02-20 04:35:34.823706631 -0200
@@ -26,10 +26,7 @@
 #include "support.h"
 #include "archive.h"
 gboolean jump_header,jump_comment,read_filename, last_line, encrypted;
-void xa_rar_delete (XArchive *,GSList *);
-void xa_rar_add (XArchive *,GString *,gchar *);
 gboolean xa_rar_extract(XArchive *,GSList *);
-void xa_rar_test (XArchive *);
 void xa_get_rar_line_content (gchar *line, gpointer data);
 void xa_open_rar ( XArchive *archive );
 #endif
diff -Nur xarchiver-0.5.3.orig/src/window.c xarchiver-0.5.3/src/window.c
--- xarchiver-0.5.3.orig/src/window.c	2014-02-20 03:24:30.795581843 -0200
+++ xarchiver-0.5.3/src/window.c	2014-02-20 05:08:49.982243849 -0200
@@ -26,7 +26,7 @@
 
 extern GList *ArchiveType;
 extern GList *ArchiveSuffix;
-extern gboolean unrar;
+extern gboolean unar;
 extern gboolean xdg_open;
 extern Prefs_dialog_data	*prefs_window;
 extern Extract_dialog_data	*extract_window;
@@ -1584,7 +1584,7 @@
 		gtk_widget_show(selected_frame);
 		gtk_widget_set_sensitive(deselect_all,TRUE);
 	}
-	if ( (archive->type == XARCHIVETYPE_RAR && unrar) || (archive->type == XARCHIVETYPE_RAR5 && unrar) || archive->type == XARCHIVETYPE_BZIP2 || archive->type == XARCHIVETYPE_GZIP || archive->type == XARCHIVETYPE_LZMA || archive->type == XARCHIVETYPE_XZ || archive->type == XARCHIVETYPE_LZOP)
+	if ( (archive->type == XARCHIVETYPE_RAR && unar) || archive->type == XARCHIVETYPE_BZIP2 || archive->type == XARCHIVETYPE_GZIP || archive->type == XARCHIVETYPE_LZMA || archive->type == XARCHIVETYPE_XZ || archive->type == XARCHIVETYPE_LZOP)
 	{
 		gtk_widget_set_sensitive (delete_menu,FALSE);
 		gtk_widget_set_sensitive (rename_menu,FALSE);
@@ -1801,7 +1801,7 @@
 	else
 		idx = xa_find_archive_index (current_page);
 
-	if ((archive[idx]->type == XARCHIVETYPE_RAR || archive[idx]->type == XARCHIVETYPE_RAR5) && unrar)
+	if ((archive[idx]->type == XARCHIVETYPE_RAR) && unar)
 	{
 		response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't perform this action:"),_("You have to install rar package!"));
 		return;