From 697c5dc91c7aa5effb4efc7a147b9f76eb84d24c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 11 Jan 2022 13:05:55 -0500 Subject: [PATCH] import gnome-autoar-0.4.1-2.el9 --- .gitignore | 2 +- .gnome-autoar.metadata | 2 +- .../build-Downgrade-meson-dependency.patch | 90 --------------- ...ld-Really-downgrade-meson-dependency.patch | 63 ---------- ...ove-leftover-referencing-schema-file.patch | 32 ------ ...ix-extraction-of-raw-format-archives.patch | 108 ++++++++++++++++++ ...tor-Fix-extraction-to-root-directory.patch | 44 +++++++ ...left-read-only-directory-in-the-tree.patch | 42 +++++++ SPECS/gnome-autoar.spec | 21 +++- 9 files changed, 212 insertions(+), 192 deletions(-) delete mode 100644 SOURCES/build-Downgrade-meson-dependency.patch delete mode 100644 SOURCES/build-Really-downgrade-meson-dependency.patch delete mode 100644 SOURCES/build-Remove-leftover-referencing-schema-file.patch create mode 100644 SOURCES/extractor-Fix-extraction-of-raw-format-archives.patch create mode 100644 SOURCES/extractor-Fix-extraction-to-root-directory.patch create mode 100644 SOURCES/tests-Do-not-left-read-only-directory-in-the-tree.patch diff --git a/.gitignore b/.gitignore index 0f84a45..ce42529 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/gnome-autoar-0.4.0.tar.xz +SOURCES/gnome-autoar-0.4.1.tar.xz diff --git a/.gnome-autoar.metadata b/.gnome-autoar.metadata index 1e4078c..9d304e2 100644 --- a/.gnome-autoar.metadata +++ b/.gnome-autoar.metadata @@ -1 +1 @@ -6f11091dda52876a6b88f45f87d57e839f6f7188 SOURCES/gnome-autoar-0.4.0.tar.xz +157eb8e8aabc988155d70320624bbf48abd04abe SOURCES/gnome-autoar-0.4.1.tar.xz diff --git a/SOURCES/build-Downgrade-meson-dependency.patch b/SOURCES/build-Downgrade-meson-dependency.patch deleted file mode 100644 index 8a6fbea..0000000 --- a/SOURCES/build-Downgrade-meson-dependency.patch +++ /dev/null @@ -1,90 +0,0 @@ -From ac21bd0c50584a1905a0da65d4bf9a6926ecd483 Mon Sep 17 00:00:00 2001 -From: Felipe Borges -Date: Wed, 11 Aug 2021 14:32:53 +0200 -Subject: [PATCH] build: Downgrade meson dependency - -Format strings got added in meson 0.58. This allows the meson -dependency to be downgraded to 0.56. - -See https://mesonbuild.com/Syntax.html#string-formatting ---- - gnome-autoar/meson.build | 12 ++++++------ - meson.build | 4 ++-- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/gnome-autoar/meson.build b/gnome-autoar/meson.build -index 30533a1..8852da8 100644 ---- a/gnome-autoar/meson.build -+++ b/gnome-autoar/meson.build -@@ -3,7 +3,7 @@ - - src_inc = include_directories('.') - --libname = f'@gnome_autoar_name@-@gnome_autoar_api_version@' -+libname= '@0@-@1@'.format(gnome_autoar_name, gnome_autoar_api_version) - - headers = files( - 'autoar-compressor.h', -@@ -31,8 +31,8 @@ enum_types = 'autoar-enum-types' - enum_sources = gnome.mkenums( - enum_types, - sources: headers, -- h_template: f'@enum_types@.h.template', -- c_template: f'@enum_types@.c.template', -+ h_template: '@0@.h.template'.format(enum_types), -+ c_template: '@0@.c.template'.format(enum_types), - install_header: true, - install_dir: gnome_autoar_includedir / libname / gnome_autoar_name, - ) -@@ -86,7 +86,7 @@ if enable_introspection - namespace: api_ns, - nsversion: gnome_autoar_api_ns_version, - identifier_prefix: gnome_autoar_api_prefix, -- export_packages: f'@api_ns@-@gnome_autoar_api_ns_version@', -+ export_packages: '@0@-@1@'.format(api_ns, gnome_autoar_api_ns_version), - install: true, - ) - -@@ -104,7 +104,7 @@ if not enable_gtk - subdir_done() - endif - --libname_gtk = f'@gnome_autoar_name@-gtk-@gnome_autoar_api_version@' -+libname_gtk = '@0@-gtk-@1@'.format(gnome_autoar_name, gnome_autoar_api_version) - - headers = files( - 'autoar-gtk-chooser.h', -@@ -161,7 +161,7 @@ if enable_introspection - namespace: api_ns, - nsversion: gnome_autoar_api_ns_version, - identifier_prefix: 'AutoarGtk', -- export_packages: f'@api_ns@-@gnome_autoar_api_ns_version@', -+ export_packages: '@0@-@1@'.format(api_ns, gnome_autoar_api_ns_version), - install: true, - ) - -diff --git a/meson.build b/meson.build -index 2c26cde..fe9afd5 100644 ---- a/meson.build -+++ b/meson.build -@@ -6,7 +6,7 @@ project( - version: '0.4.0', - license: 'LGPL2.1+', - default_options: 'buildtype=debugoptimized', -- meson_version: '>= 0.58.0', -+ meson_version: '>= 0.56.0', - ) - - gnome_autoar_name = meson.project_name() -@@ -96,7 +96,7 @@ gtk_dep = dependency( - 'gtk+-3.0', - version: gtk_req_version, - required: get_option('gtk'), -- not_found_message: f'GTK+ support requested but gtk+-3.0 @gtk_req_version@ could not be found', -+ not_found_message: 'GTK+ support requested but gtk+-3.0 @0@ could not be found'.format(gtk_req_version), - ) - enable_gtk = gtk_dep.found() - --- -2.31.1 - diff --git a/SOURCES/build-Really-downgrade-meson-dependency.patch b/SOURCES/build-Really-downgrade-meson-dependency.patch deleted file mode 100644 index 6bb3d57..0000000 --- a/SOURCES/build-Really-downgrade-meson-dependency.patch +++ /dev/null @@ -1,63 +0,0 @@ -From aacd9f21cad19be623eec4b2ae64dbd8f6a011cf Mon Sep 17 00:00:00 2001 -From: Ondrej Holy -Date: Wed, 11 Aug 2021 16:21:49 +0200 -Subject: [PATCH] build: Really downgrade meson dependency - -This is follow up for commit ac21bd0c50584a1905a0da65d4bf9a6926ecd483 -as not all the build.meson files was actually rewritten. ---- - docs/reference/meson.build | 4 ++-- - docs/reference/xml/meson.build | 4 ++-- - tests/meson.build | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/docs/reference/meson.build b/docs/reference/meson.build -index 0e9831a..58cb9f5 100644 ---- a/docs/reference/meson.build -+++ b/docs/reference/meson.build -@@ -11,11 +11,11 @@ private_headers = [ - - gnome.gtkdoc( - gnome_autoar_name, -- main_xml: f'@gnome_autoar_name@-docs.xml', -+ main_xml: '@0@-docs.xml'.format(gnome_autoar_name), - src_dir: src_inc, - dependencies: libgnome_autoar_dep, - scan_args: '--rebuild-types', -- gobject_typesfile: f'@gnome_autoar_name@.types', -+ gobject_typesfile: '@0@.types'.format(gnome_autoar_name), - ignore_headers: private_headers, - fixxref_args: '--html-dir=' + (gnome_autoar_prefix / gnome.gtkdoc_html_dir(gnome_autoar_name)), - install: true, -diff --git a/docs/reference/xml/meson.build b/docs/reference/xml/meson.build -index fb9dfce..90ba402 100644 ---- a/docs/reference/xml/meson.build -+++ b/docs/reference/xml/meson.build -@@ -3,9 +3,9 @@ - - ent_conf = { - 'PACKAGE': gnome_autoar_name, -- 'PACKAGE_BUGREPORT': f'https://gitlab.gnome.org/GNOME/@gnome_autoar_name@', -+ 'PACKAGE_BUGREPORT': 'https://gitlab.gnome.org/GNOME/@0@'.format(gnome_autoar_name), - 'PACKAGE_NAME': gnome_autoar_name, -- 'PACKAGE_STRING': f'@gnome_autoar_name@ @gnome_autoar_version@', -+ 'PACKAGE_STRING': '@0@ @1@'.format(gnome_autoar_name, gnome_autoar_version), - 'PACKAGE_TARNAME': gnome_autoar_name, - 'PACKAGE_URL': '', - 'PACKAGE_VERSION': gnome_autoar_version, -diff --git a/tests/meson.build b/tests/meson.build -index b50f221..8fff91c 100644 ---- a/tests/meson.build -+++ b/tests/meson.build -@@ -23,7 +23,7 @@ foreach test_unit: test_units - test( - test_unit[0], - exe, -- env : [f'G_TEST_SRCDIR=@source_root@'] -+ env : ['G_TEST_SRCDIR=@0@'.format(source_root)] - ) - endif - endforeach --- -2.31.1 - diff --git a/SOURCES/build-Remove-leftover-referencing-schema-file.patch b/SOURCES/build-Remove-leftover-referencing-schema-file.patch deleted file mode 100644 index f03ae0a..0000000 --- a/SOURCES/build-Remove-leftover-referencing-schema-file.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2d90da6174c03aad546802234a3d77fa0b714e6b Mon Sep 17 00:00:00 2001 -From: Felipe Borges -Date: Wed, 11 Aug 2021 15:35:52 +0200 -Subject: [PATCH] build: Remove leftover referencing schema file - -In commit bcf17c9fc095fefead731a2883d293b97b2c0dd0 the schema got -removed because it wasn't used. The meson.build file was still -referencing it. ---- - meson.build | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/meson.build b/meson.build -index 00a92d0..2c26cde 100644 ---- a/meson.build -+++ b/meson.build -@@ -105,12 +105,6 @@ enable_introspection = dependency('gobject-introspection-1.0', version: '>= 1.30 - enable_vapi = get_option('vapi') - assert(not enable_vapi or enable_introspection, 'GObject introspection support must be enabled to build VALA bindings') - --gio_schemasdir = gio_dep.get_variable( -- 'schemasdir', -- pkgconfig_define: ['datadir', gnome_autoar_datadir], -- default_value: gnome_autoar_datadir / 'glib-2.0/schemas', --) -- - subdir('gnome-autoar') - - enable_tests = get_option('tests') --- -2.31.1 - diff --git a/SOURCES/extractor-Fix-extraction-of-raw-format-archives.patch b/SOURCES/extractor-Fix-extraction-of-raw-format-archives.patch new file mode 100644 index 0000000..45038a4 --- /dev/null +++ b/SOURCES/extractor-Fix-extraction-of-raw-format-archives.patch @@ -0,0 +1,108 @@ +From b46a189982945d7154a12be59533f6385833a9cb Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Tue, 30 Nov 2021 13:39:55 +0100 +Subject: [PATCH] extractor: Fix extraction of raw format archives + +An extraction of raw format archives leads to crashes currently. +This is because the generic "data" string is returned from libarchive +instead of the real pathname, which is not expected currently. Let's +handle this case properly and fallback to the source basename. + +Fixes: https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/38 +--- + gnome-autoar/autoar-extractor.c | 53 +++++++++++++++++++-------------- + 1 file changed, 31 insertions(+), 22 deletions(-) + +diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c +index eb3edda..bb60901 100644 +--- a/gnome-autoar/autoar-extractor.c ++++ b/gnome-autoar/autoar-extractor.c +@@ -964,6 +964,7 @@ autoar_extractor_check_file_conflict (AutoarExtractor *self, + + /* 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); + } + +@@ -1664,11 +1665,15 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self) + 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 +1688,26 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self) + } + } + +- 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); +- +- 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); ++ ++ /* 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 : ""); ++ + self->files_list = + g_list_prepend (self->files_list, + autoar_extractor_do_sanitize_pathname (self, +@@ -1889,6 +1892,12 @@ autoar_extractor_step_extract (AutoarExtractor *self) { + 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); + +-- +2.33.1 + diff --git a/SOURCES/extractor-Fix-extraction-to-root-directory.patch b/SOURCES/extractor-Fix-extraction-to-root-directory.patch new file mode 100644 index 0000000..b457103 --- /dev/null +++ b/SOURCES/extractor-Fix-extraction-to-root-directory.patch @@ -0,0 +1,44 @@ +From 7237276439281abfedd619ecf6f5c17fae411137 Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Tue, 30 Nov 2021 13:45:07 +0100 +Subject: [PATCH] extractor: Fix extraction to root directory + +An extraction to the root of an archive which contains the "/" path +leads to crashes. Let's handle this rare corner case. + +Relates: https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/38 +--- + gnome-autoar/autoar-extractor.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c +index bb60901..ab68c47 100644 +--- a/gnome-autoar/autoar-extractor.c ++++ b/gnome-autoar/autoar-extractor.c +@@ -857,6 +857,14 @@ autoar_extractor_get_common_prefix (GList *files, + 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; + } + +@@ -984,7 +992,7 @@ autoar_extractor_do_write_entry (AutoarExtractor *self, + { + 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); +-- +2.33.1 + diff --git a/SOURCES/tests-Do-not-left-read-only-directory-in-the-tree.patch b/SOURCES/tests-Do-not-left-read-only-directory-in-the-tree.patch new file mode 100644 index 0000000..4cce892 --- /dev/null +++ b/SOURCES/tests-Do-not-left-read-only-directory-in-the-tree.patch @@ -0,0 +1,42 @@ +From 0f528ab688d4b01c51c0d33c3893854aae3d80ac Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Tue, 30 Nov 2021 10:53:22 +0100 +Subject: [PATCH] tests: Do not left read-only directory in the tree + +Currently, various tools fail to remove the read-only directory, which +is created as an output from the test suite. This for example breaks +package building when tests are enabled. Let's make it writable again +when test is done to fix the issue. + +Fixes: https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/34 +--- + tests/test-extract-unit.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tests/test-extract-unit.c b/tests/test-extract-unit.c +index 615ba22..5965f48 100644 +--- a/tests/test-extract-unit.c ++++ b/tests/test-extract-unit.c +@@ -1264,6 +1264,7 @@ test_readonly_directory (void) + 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 +1286,11 @@ test_readonly_directory (void) + 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 +-- +2.33.1 + diff --git a/SPECS/gnome-autoar.spec b/SPECS/gnome-autoar.spec index edbebf3..9db3406 100644 --- a/SPECS/gnome-autoar.spec +++ b/SPECS/gnome-autoar.spec @@ -1,15 +1,18 @@ Name: gnome-autoar -Version: 0.4.0 -Release: 1%{?dist} +Version: 0.4.1 +Release: 2%{?dist} Summary: Archive library License: LGPLv2+ URL: https://git.gnome.org/browse/gnome-autoar Source0: https://download.gnome.org/sources/gnome-autoar/0.4/gnome-autoar-%{version}.tar.xz -Patch0: build-Remove-leftover-referencing-schema-file.patch -Patch1: build-Downgrade-meson-dependency.patch -Patch2: build-Really-downgrade-meson-dependency.patch +# https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/38 +Patch0: extractor-Fix-extraction-of-raw-format-archives.patch +Patch1: extractor-Fix-extraction-to-root-directory.patch + +# https://gitlab.gnome.org/GNOME/gnome-autoar/-/issues/34 +Patch2: tests-Do-not-left-read-only-directory-in-the-tree.patch BuildRequires: gcc BuildRequires: meson @@ -42,6 +45,7 @@ developing applications that use %{name}. %build %meson -Dvapi=true \ -Dgtk_doc=true \ + -Dtests=true \ %{nil} %meson_build @@ -80,6 +84,13 @@ developing applications that use %{name}. %changelog +* Tue Dec 07 2021 Ondrej Holy - 0.4.1-2 +- Fix extraction of raw format archives +- Run embedded test suite as a part of the build + +* Mon Nov 01 2021 Kalev Lember - 0.4.1-1 +- Update to 0.4.1 + * Tue Aug 10 2021 Ondrej Holy - 0.4.0-1 - Update to 0.4.0