Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gnome-autoar for openSUSE:Factory checked in at 2022-01-09 22:50:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gnome-autoar (Old) and /work/SRC/openSUSE:Factory/.gnome-autoar.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-autoar" Sun Jan 9 22:50:00 2022 rev:14 rq:944774 version:0.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/gnome-autoar/gnome-autoar.changes 2021-11-06 18:17:25.792865888 +0100 +++ /work/SRC/openSUSE:Factory/.gnome-autoar.new.1892/gnome-autoar.changes 2022-01-09 22:50:09.743283418 +0100 @@ -1,0 +2,9 @@ +Fri Jan 7 15:01:13 UTC 2022 - Dominique Leuenberger <dims...@opensuse.org> + +- Update to version 0.4.2: + + Fix extraction to root directory. + + Fix extraction of raw format archives. + + Do not leave read-only directory in the tree after running + tests. + +------------------------------------------------------------------- Old: ---- gnome-autoar-0.4.1.tar.xz New: ---- gnome-autoar-0.4.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-autoar.spec ++++++ --- /var/tmp/diff_new_pack.BUKijM/_old 2022-01-09 22:50:10.187283814 +0100 +++ /var/tmp/diff_new_pack.BUKijM/_new 2022-01-09 22:50:10.195283821 +0100 @@ -1,7 +1,7 @@ # # spec file for package gnome-autoar # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: gnome-autoar -Version: 0.4.1 +Version: 0.4.2 Release: 0 Summary: Automatic archives creating and extracting library License: LGPL-2.0-or-later @@ -131,10 +131,10 @@ %files -n libgnome-autoar-0-0 %license COPYING %{_libdir}/libgnome-autoar-0.so.0 -%{_libdir}/libgnome-autoar-0.so.0.1.1 +%{_libdir}/libgnome-autoar-0.so.0.1.2 %files -n libgnome-autoar-gtk-0-0 %{_libdir}/libgnome-autoar-gtk-0.so.0 -%{_libdir}/libgnome-autoar-gtk-0.so.0.1.1 +%{_libdir}/libgnome-autoar-gtk-0.so.0.1.2 %changelog ++++++ gnome-autoar-0.4.1.tar.xz -> gnome-autoar-0.4.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/NEWS new/gnome-autoar-0.4.2/NEWS --- old/gnome-autoar-0.4.1/NEWS 2021-10-30 09:29:11.232147200 +0200 +++ new/gnome-autoar-0.4.2/NEWS 2022-01-07 10:49:41.688870400 +0100 @@ -1,3 +1,8 @@ +Major changes in 0.4.2: +* Fix extraction to root directory (Ondrej Holy) +* Fix extraction of raw format archives (Ondrej Holy) +* Do not leave read-only directory in the tree after running tests (Ondrej Holy) + Major changes in 0.4.1: * Fix regression of extraction in symlinked locations (Ondrej Holy) * Handle passphrase prompt cancellation to prevent showing error dialogs (Ondrej Holy) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/gnome-autoar/autoar-compressor.c new/gnome-autoar-0.4.2/gnome-autoar/autoar-compressor.c --- old/gnome-autoar-0.4.1/gnome-autoar/autoar-compressor.c 2021-10-30 09:29:11.234147000 +0200 +++ new/gnome-autoar-0.4.2/gnome-autoar/autoar-compressor.c 2022-01-07 10:49:41.689870400 +0100 @@ -1521,7 +1521,7 @@ GFile *file; /* Do not unref */ GFileType filetype; GFileInfo *fileinfo; - g_autofree gchar *pathname; + g_autofree gchar *pathname = NULL; file = l->data; @@ -1583,7 +1583,7 @@ self->notify_last = 0; autoar_compressor_signal_progress (self); if (archive_write_close (self->a) != ARCHIVE_OK) { - g_autofree gchar *output_name; + g_autofree gchar *output_name = NULL; output_name = autoar_common_g_file_get_name (self->output_file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/gnome-autoar/autoar-extractor.c new/gnome-autoar-0.4.2/gnome-autoar/autoar-extractor.c --- old/gnome-autoar-0.4.1/gnome-autoar/autoar-extractor.c 2021-10-30 09:29:11.234147000 +0200 +++ new/gnome-autoar-0.4.2/gnome-autoar/autoar-extractor.c 2022-01-07 10:49:41.690870500 +0100 @@ -791,8 +791,8 @@ return AUTOAR_CONFLICT_SKIP; if (*new_file) { - g_autofree char *previous_path; - g_autofree char *new_path; + g_autofree char *previous_path = NULL; + g_autofree char *new_path = NULL; previous_path = g_file_get_path (file); new_path = g_file_get_path (*new_file); @@ -857,6 +857,14 @@ while (!g_file_has_parent (prefix, root)) { file = g_file_get_parent (prefix); g_object_unref (prefix); + + /* This can happen if the archive contains the "/" path and the destination + * is "/" as well. + */ + if (file == NULL) { + return NULL; + } + prefix = file; } @@ -878,8 +886,8 @@ { GFile *extracted_filename; gboolean valid_filename; - g_autofree char *sanitized_pathname; - g_autofree char *utf8_pathname; + g_autofree char *sanitized_pathname = NULL; + g_autofree char *utf8_pathname = NULL; GFile *destination; /* Use output_file when called from autoar_extractor_step_scan_toplevel(). */ @@ -898,7 +906,7 @@ g_file_has_prefix (extracted_filename, destination); if (!valid_filename) { - g_autofree char *basename; + g_autofree char *basename = NULL; basename = g_file_get_basename (extracted_filename); @@ -909,7 +917,7 @@ if (self->prefix != NULL && self->new_prefix != NULL && !g_file_equal (self->prefix, self->new_prefix)) { - g_autofree char *relative_path; + g_autofree char *relative_path = NULL; /* Replace the old prefix with the new one */ relative_path = g_file_get_relative_path (self->prefix, extracted_filename); @@ -964,6 +972,7 @@ /* Check also parents for conflict to be sure it is directory. */ parent = g_file_get_parent (file); + g_return_val_if_fail (parent, NULL); return autoar_extractor_check_file_conflict (self, parent, AE_IFDIR); } @@ -983,7 +992,7 @@ { GFile *parent; parent = g_file_get_parent (dest); - if (!g_file_query_exists (parent, self->cancellable)) + if (parent && !g_file_query_exists (parent, self->cancellable)) g_file_make_directory_with_parents (parent, self->cancellable, NULL); @@ -1664,11 +1673,15 @@ return; } self->use_raw_format = TRUE; + + g_debug ("autoar_extractor_step_scan_toplevel: using raw format"); } while ((r = archive_read_next_header (a, &entry)) == ARCHIVE_OK) { const char *pathname; g_autofree char *utf8_pathname = NULL; + const char *symlink_pathname; + const char *hardlink_pathname; if (g_cancellable_is_cancelled (self->cancellable)) { archive_read_free (a); @@ -1683,28 +1696,26 @@ } } - if (self->use_raw_format) { - pathname = autoar_common_get_basename_remove_extension (g_file_peek_path (self->source_file)); - g_debug ("autoar_extractor_step_scan_toplevel: %d: raw pathname = %s", - self->total_files, pathname); - } else { - const char *symlink_pathname; - const char *hardlink_pathname; + pathname = archive_entry_pathname (entry); + utf8_pathname = autoar_common_get_utf8_pathname (pathname); + symlink_pathname = archive_entry_symlink (entry); + hardlink_pathname = archive_entry_hardlink (entry); + + /* The raw format usually doesn't propagate file name and the generic "data" + * string is returned instead. Let's use source basename in that case. + */ + if (self->use_raw_format && g_str_equal (pathname, "data")) + pathname = autoar_common_get_basename_remove_extension (self->source_basename); + + g_debug ("autoar_extractor_step_scan_toplevel: %d: pathname = %s%s%s%s%s%s%s", + self->total_files, pathname, + utf8_pathname ? " utf8 pathname = " : "", + utf8_pathname ? utf8_pathname : "", + symlink_pathname ? " symlink = " : "", + symlink_pathname ? symlink_pathname : "", + hardlink_pathname ? " hardlink = " : "", + hardlink_pathname ? hardlink_pathname : ""); - pathname = archive_entry_pathname (entry); - utf8_pathname = autoar_common_get_utf8_pathname (pathname); - symlink_pathname = archive_entry_symlink (entry); - hardlink_pathname = archive_entry_hardlink (entry); - - g_debug ("autoar_extractor_step_scan_toplevel: %d: pathname = %s%s%s%s%s%s%s", - self->total_files, pathname, - utf8_pathname ? " utf8 pathname = " : "", - utf8_pathname ? utf8_pathname : "", - symlink_pathname ? " symlink = " : "", - symlink_pathname ? symlink_pathname : "", - hardlink_pathname ? " hardlink = " : "", - hardlink_pathname ? hardlink_pathname : ""); - } self->files_list = g_list_prepend (self->files_list, autoar_extractor_do_sanitize_pathname (self, @@ -1769,8 +1780,8 @@ * the extension). If they do, then the destination should be the output * directory itself. */ - g_autofree char *prefix_name; - g_autofree char *prefix_name_no_ext; + g_autofree char *prefix_name = NULL; + g_autofree char *prefix_name_no_ext = NULL; g_debug ("autoar_extractor_step_set_destination: pathname_prefix = %s", g_file_peek_path (self->prefix)); @@ -1802,7 +1813,7 @@ GList *files = NULL; GList *l; GFile *new_destination = NULL; - g_autofree char *destination_name; + g_autofree char *destination_name = NULL; for (l = self->files_list; l != NULL; l = l->next) { char *relative_path; @@ -1889,6 +1900,12 @@ pathname = archive_entry_pathname (entry); hardlink = archive_entry_hardlink (entry); + /* The raw format usually doesn't propagate file name and the generic "data" + * string is returned instead. Let's use source basename in that case. + */ + if (self->use_raw_format && g_str_equal (pathname, "data")) + pathname = autoar_common_get_basename_remove_extension (self->source_basename); + extracted_filename = autoar_extractor_do_sanitize_pathname (self, pathname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/meson.build new/gnome-autoar-0.4.2/meson.build --- old/gnome-autoar-0.4.1/meson.build 2021-10-30 09:29:11.235147200 +0200 +++ new/gnome-autoar-0.4.2/meson.build 2022-01-07 10:49:41.691870500 +0100 @@ -3,7 +3,7 @@ project( 'gnome-autoar', 'c', - version: '0.4.1', + version: '0.4.2', license: 'LGPL2.1+', default_options: 'buildtype=debugoptimized', meson_version: '>= 0.56.0', @@ -25,7 +25,7 @@ # # When bumping the first component version, set the second and third components # to 0. When bumping the second version, set the third one to zero. -gnome_autoar_libversion = '0.1.1' +gnome_autoar_libversion = '0.1.2' gnome_autoar_api_version = 0 Binary files old/gnome-autoar-0.4.1/tests/files/extract/test-raw-named/input/arextract.gz and new/gnome-autoar-0.4.2/tests/files/extract/test-raw-named/input/arextract.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/tests/files/extract/test-raw-named/reference/arextractdifferent new/gnome-autoar-0.4.2/tests/files/extract/test-raw-named/reference/arextractdifferent --- old/gnome-autoar-0.4.1/tests/files/extract/test-raw-named/reference/arextractdifferent 1970-01-01 01:00:00.000000000 +0100 +++ new/gnome-autoar-0.4.2/tests/files/extract/test-raw-named/reference/arextractdifferent 2022-01-07 10:49:41.693870500 +0100 @@ -0,0 +1 @@ +?o?c??< \ No newline at end of file Binary files old/gnome-autoar-0.4.1/tests/files/extract/test-raw-unnamed/input/arextract.gz and new/gnome-autoar-0.4.2/tests/files/extract/test-raw-unnamed/input/arextract.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/tests/files/extract/test-raw-unnamed/reference/arextract new/gnome-autoar-0.4.2/tests/files/extract/test-raw-unnamed/reference/arextract --- old/gnome-autoar-0.4.1/tests/files/extract/test-raw-unnamed/reference/arextract 1970-01-01 01:00:00.000000000 +0100 +++ new/gnome-autoar-0.4.2/tests/files/extract/test-raw-unnamed/reference/arextract 2022-01-07 10:49:41.693870500 +0100 @@ -0,0 +1 @@ +?o?c??< \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/tests/test-extract-unit.c new/gnome-autoar-0.4.2/tests/test-extract-unit.c --- old/gnome-autoar-0.4.1/tests/test-extract-unit.c 2021-10-30 09:29:11.239147200 +0200 +++ new/gnome-autoar-0.4.2/tests/test-extract-unit.c 2022-01-07 10:49:41.695870400 +0100 @@ -64,7 +64,7 @@ GFileInfo *info; while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) { - g_autoptr (GFile) child; + g_autoptr (GFile) child = NULL; child = g_file_get_child (directory, g_file_info_get_name (info)); @@ -334,8 +334,8 @@ NULL, NULL)); while (!g_queue_is_empty (files)) { - g_autoptr (GFile) file; - g_autoptr (GFileInfo) file_info; + g_autoptr (GFile) file = NULL; + g_autoptr (GFileInfo) file_info = NULL; file = g_queue_pop_tail (files); file_info = g_queue_pop_tail (file_infos); @@ -398,7 +398,7 @@ gpointer user_data) { ExtractTest *extract_test = user_data; - g_autofree char *relative_path; + g_autofree char *relative_path = NULL; GFileInfo *corresponding_file_info; relative_path = scanned_file == extract_test->reference ? @@ -654,6 +654,90 @@ } static void +test_raw_named (void) +{ + /* arextract.gz + * ????????? arextractdifferent + * + * 0 directories, 1 file + * + * + * ref + * ????????? arextractdifferent + * + * 0 directories, 1 file + */ + + g_autoptr (ExtractTest) extract_test = NULL; + g_autoptr (ExtractTestData) data = NULL; + g_autoptr (GFile) archive = NULL; + g_autoptr (AutoarExtractor) extractor = NULL; + + extract_test = extract_test_new ("test-raw-named"); + + if (!extract_test) { + g_assert_nonnull (extract_test); + return; + } + + archive = g_file_get_child (extract_test->input, "arextract.gz"); + + extractor = autoar_extractor_new (archive, extract_test->output); + autoar_extractor_set_output_is_dest (extractor, TRUE); + + data = extract_test_data_new_for_extract (extractor); + + autoar_extractor_start (extractor, data->cancellable); + + g_assert_cmpuint (data->number_of_files, ==, 1); + g_assert_no_error (data->error); + g_assert_true (data->completed_signalled); + assert_reference_and_output_match (extract_test); +} + +static void +test_raw_unnamed (void) +{ + /* arextract.gz + * ????????? arextract + * + * 0 directories, 1 file + * + * + * ref + * ????????? arextract + * + * 0 directories, 1 file + */ + + g_autoptr (ExtractTest) extract_test = NULL; + g_autoptr (ExtractTestData) data = NULL; + g_autoptr (GFile) archive = NULL; + g_autoptr (AutoarExtractor) extractor = NULL; + + extract_test = extract_test_new ("test-raw-unnamed"); + + if (!extract_test) { + g_assert_nonnull (extract_test); + return; + } + + archive = g_file_get_child (extract_test->input, "arextract.gz"); + + extractor = autoar_extractor_new (archive, extract_test->output); + autoar_extractor_set_output_is_dest (extractor, TRUE); + + data = extract_test_data_new_for_extract (extractor); + + autoar_extractor_start (extractor, data->cancellable); + + g_assert_cmpuint (data->number_of_files, ==, 1); + g_assert_no_error (data->error); + g_assert_true (data->completed_signalled); + assert_reference_and_output_match (extract_test); +} + +static void test_conflict_overwrite (void) { /* arextract.zip @@ -1264,6 +1348,7 @@ g_autoptr (ExtractTest) extract_test = NULL; g_autoptr (ExtractTestData) data = NULL; g_autoptr (GFile) archive = NULL; + g_autoptr (GFile) readonly = NULL; g_autoptr (AutoarExtractor) extractor = NULL; extract_test = extract_test_new ("test-readonly-directory"); @@ -1285,6 +1370,11 @@ g_assert_no_error (data->error); g_assert_true (data->completed_signalled); assert_reference_and_output_match (extract_test); + + /* Make the directory writable again to avoid issues when deleting. */ + readonly = g_file_get_child (extract_test->output, "arextract"); + g_file_set_attribute_uint32 (readonly, G_FILE_ATTRIBUTE_UNIX_MODE, 0755, + G_FILE_QUERY_INFO_NONE, NULL, NULL); } static void @@ -1301,6 +1391,11 @@ g_test_add_func ("/autoar-extract/test-multiple-files-different-name", test_multiple_files_different_name); + g_test_add_func ("/autoar-extract/test-raw-named", + test_raw_named); + g_test_add_func ("/autoar-extract/test-raw-unnamed", + test_raw_unnamed); + g_test_add_func ("/autoar-extract/test-conflict-overwrite", test_conflict_overwrite); g_test_add_func ("/autoar-extract/test-conflict-overwrite-nonempty-directory", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-autoar-0.4.1/tests/test-extract.c new/gnome-autoar-0.4.2/tests/test-extract.c --- old/gnome-autoar-0.4.1/tests/test-extract.c 2021-10-30 09:29:11.239147200 +0200 +++ new/gnome-autoar-0.4.2/tests/test-extract.c 2022-01-07 10:49:41.695870400 +0100 @@ -59,7 +59,7 @@ GFile **new_file, gpointer data) { - g_autofree char *path; + g_autofree char *path = NULL; path = g_file_get_path (file);