[file-roller] fixed creation of multi-volume archives
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [file-roller] fixed creation of multi-volume archives
- Date: Tue,  2 Oct 2012 19:09:04 +0000 (UTC)
commit 547c57e00d5e8585b129c95f9d5d2b1abd086d46
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Oct 2 20:37:27 2012 +0200
    fixed creation of multi-volume archives
    
    [fixed bug]
 src/fr-command.c |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/src/fr-command.c b/src/fr-command.c
index a091409..49d3669 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -914,6 +914,7 @@ _fr_command_add (FrCommand      *self,
 	char      *tmp_archive_filename = NULL;
 	gboolean   error_occurred = FALSE;
 	int        new_file_list_length;
+	gboolean   use_tmp_subdirectory;
 
 	if (file_list == NULL)
 		return FALSE;
@@ -977,7 +978,9 @@ _fr_command_add (FrCommand      *self,
 	 * to cancel the operation without losing the original archive and
 	 * removing possible temporary files created by the command. */
 
-	{
+	use_tmp_subdirectory = (volume_size == 0) || ! fr_archive_is_capable_of (FR_ARCHIVE (self), FR_ARCHIVE_CAN_CREATE_VOLUMES);
+
+	if (use_tmp_subdirectory) {
 		GFile *local_copy_parent;
 		char  *archive_dir;
 		GFile *tmp_file;
@@ -1102,20 +1105,22 @@ _fr_command_add (FrCommand      *self,
 
 		/* move the new archive to the original position */
 
-		fr_process_begin_command (self->process, "mv");
-		fr_process_add_arg (self->process, "-f");
-		fr_process_add_arg (self->process, tmp_archive_filename);
-		fr_process_add_arg (self->process, archive_filename);
-		fr_process_end_command (self->process);
+		if (use_tmp_subdirectory) {
+			fr_process_begin_command (self->process, "mv");
+			fr_process_add_arg (self->process, "-f");
+			fr_process_add_arg (self->process, tmp_archive_filename);
+			fr_process_add_arg (self->process, archive_filename);
+			fr_process_end_command (self->process);
 
-		/* remove the temp sub-directory */
+			/* remove the temp sub-directory */
 
-		fr_process_begin_command (self->process, "rm");
-		fr_process_set_working_dir (self->process, g_get_tmp_dir ());
-		fr_process_set_sticky (self->process, TRUE);
-		fr_process_add_arg (self->process, "-rf");
-		fr_process_add_arg (self->process, tmp_archive_dir);
-		fr_process_end_command (self->process);
+			fr_process_begin_command (self->process, "rm");
+			fr_process_set_working_dir (self->process, g_get_tmp_dir ());
+			fr_process_set_sticky (self->process, TRUE);
+			fr_process_add_arg (self->process, "-rf");
+			fr_process_add_arg (self->process, tmp_archive_dir);
+			fr_process_end_command (self->process);
+		}
 
 		/* remove the archive dir */
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]