file-roller r2403 - in trunk: . src



Author: paobac
Date: Tue Aug  5 09:12:57 2008
New Revision: 2403
URL: http://svn.gnome.org/viewvc/file-roller?rev=2403&view=rev

Log:
2008-08-05  Paolo Bacchilega  <paobac svn gnome org>
	
	* src/fr-command.h: 
	* src/fr-archive.c: added a creating_archive flag to FrCommand this 
	way special options	can be used when fr_command_add is called to create
	an archive.
	
	* src/fr-command-tar.c: when creating a new archive, compress it 
	directly instead of creating it	uncompressed and then compress it.
	This saves time and disk space.
	
	Fixes bug #542424 â Tar.bz2 archives create uncompressed archive files


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/fr-archive.c
   trunk/src/fr-command-tar.c
   trunk/src/fr-command.h

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Tue Aug  5 09:12:57 2008
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.61)
 
-AC_INIT(file-roller, 2.23.5, [http://bugzilla.gnome.org/enter_bug.cgi?product=file-roller])
+AC_INIT(file-roller, 2.23.6, [http://bugzilla.gnome.org/enter_bug.cgi?product=file-roller])
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 
 AC_CONFIG_SRCDIR([config.h.in])

Modified: trunk/src/fr-archive.c
==============================================================================
--- trunk/src/fr-archive.c	(original)
+++ trunk/src/fr-archive.c	Tue Aug  5 09:12:57 2008
@@ -1594,7 +1594,10 @@
 		return;
 	}
 
-	fr_command_uncompress (archive->command);
+	archive->command->creating_archive = ! g_file_test (archive->command->filename, G_FILE_TEST_EXISTS);
+	
+	if (! archive->command->creating_archive)
+		fr_command_uncompress (archive->command);
 
 	/* when files are already present in a tar archive and are added
 	 * again, they are not replaced, so we have to delete them first. */
@@ -1691,7 +1694,8 @@
 	path_list_free (new_file_list);
 
 	if (! error_occurred) {
-		fr_command_recompress (archive->command);
+		if (! archive->command->creating_archive)
+			fr_command_recompress (archive->command);
 
 		if (base_dir_created) { /* remove the temp dir */
 			fr_process_begin_command (archive->process, "rm");

Modified: trunk/src/fr-command-tar.c
==============================================================================
--- trunk/src/fr-command-tar.c	(original)
+++ trunk/src/fr-command-tar.c	Tue Aug  5 09:12:57 2008
@@ -315,8 +315,15 @@
 		fr_process_add_arg (comm->process, base_dir);
 	}
 
-	fr_process_add_arg (comm->process, "-rf");
-	fr_process_add_arg (comm->process, c_tar->uncomp_filename);
+	if (comm->creating_archive) {
+		fr_process_add_arg (comm->process, "-cf");
+		fr_process_add_arg (comm->process, comm->filename);
+		add_compress_arg (comm);
+	}
+	else {
+		fr_process_add_arg (comm->process, "-rf");
+		fr_process_add_arg (comm->process, c_tar->uncomp_filename);
+	}
 
 	if (from_file != NULL) {
 		fr_process_add_arg (comm->process, "-T");

Modified: trunk/src/fr-command.h
==============================================================================
--- trunk/src/fr-command.h	(original)
+++ trunk/src/fr-command.h	Tue Aug  5 09:12:57 2008
@@ -84,6 +84,7 @@
 	gboolean       encrypt_header : 1;
 	FrCompression  compression;
 	guint          volume_size;
+	gboolean       creating_archive;
 
 	/* features. */
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]