Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-arch/file-roller/files: file-roller-3.8.4-modifications-time.patch file-roller-3.8.4-ignore-errors.patch file-roller-3.8.4-extract-failure.patch
Date: Sat, 26 Oct 2013 19:09:39
Message-Id: 20131026190933.430D420047@flycatcher.gentoo.org
1 pacho 13/10/26 19:09:33
2
3 Added: file-roller-3.8.4-modifications-time.patch
4 file-roller-3.8.4-ignore-errors.patch
5 file-roller-3.8.4-extract-failure.patch
6 Log:
7 Apply upstream patches fixing some problems when unpacking (#489074 by Philipp Leonhardt), drop old.
8
9 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
10
11 Revision Changes Path
12 1.1 app-arch/file-roller/files/file-roller-3.8.4-modifications-time.patch
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-modifications-time.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-modifications-time.patch?rev=1.1&content-type=text/plain
16
17 Index: file-roller-3.8.4-modifications-time.patch
18 ===================================================================
19 From 4bf8552f8e60c8d4ec65e360451c6998198052db Mon Sep 17 00:00:00 2001
20 From: Paolo Bacchilega <paobac@×××××××××.org>
21 Date: Wed, 04 Sep 2013 10:02:11 +0000
22 Subject: libarchive: restore the folders modification time correctly
23
24 when honoring the skip_older and overwrite flags ignore the
25 directories created during the extraction process.
26
27 [bug #697756]
28 ---
29 diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
30 index 3b73c48..37e3008 100644
31 --- a/src/fr-archive-libarchive.c
32 +++ b/src/fr-archive-libarchive.c
33 @@ -33,6 +33,7 @@
34 #include "file-utils.h"
35 #include "fr-error.h"
36 #include "fr-archive-libarchive.h"
37 +#include "gio-utils.h"
38 #include "glib-utils.h"
39 #include "typedefs.h"
40
41 @@ -547,6 +548,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
42 LoadData *load_data;
43 GHashTable *checked_folders;
44 GHashTable *created_folders;
45 + GHashTable *folders_created_during_extraction;
46 struct archive *a;
47 struct archive_entry *entry;
48 int r;
49 @@ -556,6 +558,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
50
51 checked_folders = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL);
52 created_folders = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, g_object_unref);
53 + folders_created_during_extraction = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL);
54 fr_archive_progress_set_total_files (load_data->archive, extract_data->n_files_to_extract);
55
56 a = archive_read_new ();
57 @@ -590,11 +593,14 @@ extract_archive_thread (GSimpleAsyncResult *result,
58 archive_read_data_skip (a);
59 continue;
60 }
61 +
62 file = g_file_get_child (extract_data->destination, relative_path);
63
64 /* honor the skip_older and overwrite options */
65
66 - if (extract_data->skip_older || ! extract_data->overwrite) {
67 + if ((g_hash_table_lookup (folders_created_during_extraction, file) == NULL)
68 + && (extract_data->skip_older || ! extract_data->overwrite))
69 + {
70 GFileInfo *info;
71
72 info = g_file_query_info (file,
73 @@ -652,7 +658,18 @@ extract_archive_thread (GSimpleAsyncResult *result,
74 && (g_hash_table_lookup (checked_folders, parent) == NULL)
75 && ! g_file_query_exists (parent, cancellable))
76 {
77 - if (g_file_make_directory_with_parents (parent, cancellable, &load_data->error)) {
78 + if (! _g_file_make_directory_with_parents (parent,
79 + folders_created_during_extraction,
80 + cancellable,
81 + &local_error))
82 + {
83 + if (! g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_EXISTS))
84 + load_data->error = local_error;
85 + else
86 + g_clear_error (&local_error);
87 + }
88 +
89 + if (load_data->error == NULL) {
90 GFile *grandparent;
91
92 grandparent = g_object_ref (parent);
93 @@ -736,7 +753,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
94 load_data->error = g_error_copy (local_error);
95 g_error_free (local_error);
96 }
97 - else {
98 + if (load_data->error == NULL) {
99 GFileInfo *info;
100
101 info = _g_file_info_create_from_entry (entry, extract_data);
102 @@ -803,6 +820,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
103 if (load_data->error != NULL)
104 g_simple_async_result_set_from_error (result, load_data->error);
105
106 + g_hash_table_unref (folders_created_during_extraction);
107 g_hash_table_unref (created_folders);
108 g_hash_table_unref (checked_folders);
109 archive_read_free (a);
110 diff --git a/src/gio-utils.c b/src/gio-utils.c
111 index 9d9f708..b317694 100644
112 --- a/src/gio-utils.c
113 +++ b/src/gio-utils.c
114 @@ -1483,3 +1483,73 @@ _g_file_load_buffer_finish (GFile *file,
115
116 return TRUE;
117 }
118 +
119 +
120 +static gboolean
121 +_g_file_make_directory_and_add_to_created_folders (GFile *file,
122 + GHashTable *created_folders,
123 + GCancellable *cancellable,
124 + GError **error)
125 +{
126 + gboolean result;
127 +
128 + result = g_file_make_directory (file, cancellable, error);
129 + if (result && (g_hash_table_lookup (created_folders, file) == NULL))
130 + g_hash_table_insert (created_folders, g_object_ref (file), GINT_TO_POINTER (1));
131 +
132 + return result;
133 +}
134 +
135 +
136 +gboolean
137 +_g_file_make_directory_with_parents (GFile *file,
138 + GHashTable *created_folders,
139 + GCancellable *cancellable,
140 + GError **error)
141 +{
142 + GError *local_error = NULL;
143 + GFile *work_file = NULL;
144 + GList *list = NULL, *l;
145 +
146 + g_return_val_if_fail (G_IS_FILE (file), FALSE);
147 +
148 + _g_file_make_directory_and_add_to_created_folders (file, created_folders, cancellable, &local_error);
149 + if ((local_error == NULL) || (local_error->code != G_IO_ERROR_NOT_FOUND)) {
150 + if (local_error != NULL)
151 + g_propagate_error (error, local_error);
152 + return local_error == NULL;
153 + }
154 +
155 + work_file = g_object_ref (file);
156 + while ((local_error != NULL) && (local_error->code == G_IO_ERROR_NOT_FOUND)) {
157 + GFile *parent_file;
158 +
159 + parent_file = g_file_get_parent (work_file);
160 + if (parent_file == NULL)
161 + break;
162 +
163 + g_clear_error (&local_error);
164 + _g_file_make_directory_and_add_to_created_folders (parent_file, created_folders, cancellable, &local_error);
165 +
166 + g_object_unref (work_file);
167 + work_file = g_object_ref (parent_file);
168 +
169 + if ((local_error != NULL) && (local_error->code == G_IO_ERROR_NOT_FOUND))
170 + list = g_list_prepend (list, parent_file); /* Transfer ownership of ref */
171 + else
172 + g_object_unref (parent_file);
173 + }
174 +
175 + for (l = list; (local_error == NULL) && (l != NULL); l = l->next)
176 + _g_file_make_directory_and_add_to_created_folders ((GFile *) l->data, created_folders, cancellable, &local_error);
177 +
178 + _g_object_unref (work_file);
179 + _g_object_list_unref (list);
180 +
181 + if (local_error != NULL) {
182 + g_propagate_error (error, local_error);
183 + return FALSE;
184 + }
185 +
186 + return _g_file_make_directory_and_add_to_created_folders (file, created_folders, cancellable, error);
187 +}
188 diff --git a/src/gio-utils.h b/src/gio-utils.h
189 index f784c41..0d7dd3c 100644
190 --- a/src/gio-utils.h
191 +++ b/src/gio-utils.h
192 @@ -177,5 +177,10 @@ gboolean _g_file_load_buffer_finish (GFile *file,
193 char **buffer,
194 gsize *buffer_size,
195 GError **error);
196 +gboolean _g_file_make_directory_with_parents
197 + (GFile *file,
198 + GHashTable *created_folders,
199 + GCancellable *cancellable,
200 + GError **error);
201
202 #endif /* _GIO_UTILS_H */
203 --
204 cgit v0.9.2
205
206
207
208 1.1 app-arch/file-roller/files/file-roller-3.8.4-ignore-errors.patch
209
210 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-ignore-errors.patch?rev=1.1&view=markup
211 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-ignore-errors.patch?rev=1.1&content-type=text/plain
212
213 Index: file-roller-3.8.4-ignore-errors.patch
214 ===================================================================
215 From 80c36ae3c84dce8716eb5b74ddb8c73da5824f13 Mon Sep 17 00:00:00 2001
216 From: Paolo Bacchilega <paobac@×××××××××.org>
217 Date: Fri, 11 Oct 2013 19:38:27 +0000
218 Subject: ignore errors when setting file attributes
219
220 [bug #709932]
221 ---
222 diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
223 index 44aaad2..19c5a1d 100644
224 --- a/src/fr-archive-libarchive.c
225 +++ b/src/fr-archive-libarchive.c
226 @@ -751,7 +751,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
227 GFileInfo *info;
228
229 info = _g_file_info_create_from_entry (entry, extract_data);
230 - _g_file_set_attributes_from_info (file, info, cancellable, &load_data->error);
231 + _g_file_set_attributes_from_info (file, info, cancellable, NULL);
232 g_hash_table_insert (created_folders, g_object_ref (file), g_object_ref (info));
233
234 g_object_unref (info);
235 @@ -774,7 +774,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
236 if (r != ARCHIVE_EOF)
237 load_data->error = g_error_new_literal (FR_ERROR, FR_ERROR_COMMAND_ERROR, archive_error_string (a));
238 else
239 - _g_file_set_attributes_from_entry (file, entry, extract_data, cancellable, &load_data->error);
240 + _g_file_set_attributes_from_entry (file, entry, extract_data, cancellable, NULL);
241 break;
242
243 case AE_IFLNK:
244 @@ -805,7 +805,7 @@ extract_archive_thread (GSimpleAsyncResult *result,
245 }
246
247 if (load_data->error == NULL)
248 - restore_modification_time (created_folders, cancellable, &load_data->error);
249 + restore_modification_time (created_folders, cancellable, NULL);
250
251 if ((load_data->error == NULL) && (r != ARCHIVE_EOF))
252 load_data->error = g_error_new_literal (FR_ERROR, FR_ERROR_COMMAND_ERROR, archive_error_string (a));
253 --
254 cgit v0.9.2
255
256
257
258 1.1 app-arch/file-roller/files/file-roller-3.8.4-extract-failure.patch
259
260 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-extract-failure.patch?rev=1.1&view=markup
261 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/file-roller/files/file-roller-3.8.4-extract-failure.patch?rev=1.1&content-type=text/plain
262
263 Index: file-roller-3.8.4-extract-failure.patch
264 ===================================================================
265 From 40d2c298a7b938a974fe83b609293348a7d59bbd Mon Sep 17 00:00:00 2001
266 From: Paolo Bacchilega <paobac@×××××××××.org>
267 Date: Sun, 29 Sep 2013 16:30:29 +0000
268 Subject: libarchive: fixed failure when extracting some tar archives
269
270 do not try to restore the creation time;
271 do not set the G_FILE_ATTRIBUTE_TIME_CREATED_USEC attribute
272
273 [bug #709035]
274 ---
275 diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
276 index 37e3008..e465fe8 100644
277 --- a/src/fr-archive-libarchive.c
278 +++ b/src/fr-archive-libarchive.c
279 @@ -428,15 +428,8 @@ _g_file_info_create_from_entry (struct archive_entry *entry,
280
281 /* times */
282
283 - if (archive_entry_ctime_is_set (entry)) {
284 - g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_CREATED, archive_entry_ctime (entry));
285 - g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_CREATED_USEC, archive_entry_ctime_nsec (entry));
286 - }
287 -
288 - if (archive_entry_mtime_is_set (entry)) {
289 + if (archive_entry_mtime_is_set (entry))
290 g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, archive_entry_mtime (entry));
291 - g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, archive_entry_mtime_nsec (entry));
292 - }
293
294 /* username */
295
296 @@ -529,7 +522,8 @@ restore_modification_time (GHashTable *created_folders,
297
298 info = g_file_info_new ();
299 g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, g_file_info_get_attribute_uint64 (original_info, G_FILE_ATTRIBUTE_TIME_MODIFIED));
300 - g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, g_file_info_get_attribute_uint32 (original_info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC));
301 + if (g_file_info_get_attribute_status (original_info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC) == G_FILE_ATTRIBUTE_STATUS_SET)
302 + g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, g_file_info_get_attribute_uint32 (original_info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC));
303 result = _g_file_set_attributes_from_info (file, info, cancellable, error);
304
305 g_object_unref (info);
306 --
307 cgit v0.9.2