Revert a patch from upstream

This commit is contained in:
Richard Hughes 2019-04-17 16:07:11 +01:00
parent 1fed67dd52
commit 957fa164e2
2 changed files with 147 additions and 1 deletions

View File

@ -0,0 +1,140 @@
From 21dbdea0d16644f3cb98c9e5f24700a5ff13c55f Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Wed, 17 Apr 2019 16:03:11 +0100
Subject: [PATCH] Revert "Require --force to install a release with a different
version format"
This reverts commit ce3cea8cb49bee10078d72b835792a18b85f6be5.
---
src/fu-install-task.c | 35 --------------------------------
src/fu-self-test.c | 47 -------------------------------------------
2 files changed, 82 deletions(-)
diff --git a/src/fu-install-task.c b/src/fu-install-task.c
index 5e44db5b..1ef286b5 100644
--- a/src/fu-install-task.c
+++ b/src/fu-install-task.c
@@ -92,20 +92,6 @@ fu_install_task_get_is_downgrade (FuInstallTask *self)
return self->is_downgrade;
}
-static FuVersionFormat
-fu_install_task_guess_version_format (FuInstallTask *self, const gchar *version)
-{
- const gchar *tmp;
-
- /* explicit set */
- tmp = xb_node_query_text (self->component, "custom/value[@key='LVFS::VersionFormat']", NULL);
- if (tmp != NULL)
- return fu_common_version_format_from_string (tmp);
-
- /* count section from dotted notation */
- return fu_common_version_guess_format (version);
-}
-
/**
* fu_install_task_check_requirements:
* @self: A #FuInstallTask
@@ -123,7 +109,6 @@ fu_install_task_check_requirements (FuInstallTask *self,
FwupdInstallFlags flags,
GError **error)
{
- FuVersionFormat fmt;
const gchar *version;
const gchar *version_release;
const gchar *version_lowest;
@@ -232,26 +217,6 @@ fu_install_task_check_requirements (FuInstallTask *self,
return FALSE;
}
- /* check the version formats match */
- fmt = fu_install_task_guess_version_format (self, version_release);
- if (fmt != fu_device_get_version_format (self->device)) {
- FuVersionFormat fmt_dev = fu_device_get_version_format (self->device);
- if (flags & FWUPD_INSTALL_FLAG_FORCE) {
- g_warning ("ignoring version format difference %s:%s",
- fu_common_version_format_to_string (fmt_dev),
- fu_common_version_format_to_string (fmt));
- } else {
- g_set_error (error,
- FWUPD_ERROR,
- FWUPD_ERROR_NOT_SUPPORTED,
- "Firmware version formats were different, "
- "device was '%s' and release is '%s'",
- fu_common_version_format_to_string (fmt_dev),
- fu_common_version_format_to_string (fmt));
- return FALSE;
- }
- }
-
/* compare to the lowest supported version, if it exists */
version_lowest = fu_device_get_version_lowest (self->device);
if (version_lowest != NULL &&
diff --git a/src/fu-self-test.c b/src/fu-self-test.c
index 8553487f..3b6e2a31 100644
--- a/src/fu-self-test.c
+++ b/src/fu-self-test.c
@@ -433,52 +433,6 @@ fu_engine_requirements_device_func (void)
g_assert (ret);
}
-static void
-fu_engine_requirements_version_format_func (void)
-{
- gboolean ret;
- g_autoptr(FuDevice) device = fu_device_new ();
- g_autoptr(FuEngine) engine = fu_engine_new (FU_APP_FLAGS_NONE);
- g_autoptr(FuInstallTask) task = NULL;
- g_autoptr(GError) error = NULL;
- g_autoptr(XbNode) component = NULL;
- g_autoptr(XbSilo) silo = NULL;
- const gchar *xml =
- "<component>"
- " <provides>"
- " <firmware type=\"flashed\">12345678-1234-1234-1234-123456789012</firmware>"
- " </provides>"
- " <releases>"
- " <release version=\"1.2.4\">"
- " <checksum type=\"sha1\" filename=\"bios.bin\" target=\"content\"/>"
- " </release>"
- " </releases>"
- "</component>";
-
- /* set up a dummy device */
- fu_device_set_version (device, "1.2.3.4");
- fu_device_add_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE);
- fu_device_add_guid (device, "12345678-1234-1234-1234-123456789012");
-
- /* make the component require three things */
- silo = xb_silo_new_from_xml (xml, &error);
- g_assert_no_error (error);
- g_assert_nonnull (silo);
- component = xb_silo_query_first (silo, "component", &error);
- g_assert_no_error (error);
- g_assert_nonnull (component);
-
- /* check this fails */
- task = fu_install_task_new (device, component);
- ret = fu_engine_check_requirements (engine, task,
- FWUPD_INSTALL_FLAG_NONE,
- &error);
- g_assert_error (error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED);
- g_assert_nonnull (g_strstr_len (error->message, -1,
- "Firmware version formats were different"));
- g_assert (!ret);
-}
-
static void
fu_engine_requirements_other_device_func (void)
{
@@ -3710,7 +3664,6 @@ main (int argc, char **argv)
g_test_add_func ("/fwupd/engine{requirements-not-child-fail}", fu_engine_requirements_child_fail_func);
g_test_add_func ("/fwupd/engine{requirements-unsupported}", fu_engine_requirements_unsupported_func);
g_test_add_func ("/fwupd/engine{requirements-device}", fu_engine_requirements_device_func);
- g_test_add_func ("/fwupd/engine{requirements-version-format}", fu_engine_requirements_version_format_func);
g_test_add_func ("/fwupd/engine{device-auto-parent}", fu_engine_device_parent_func);
g_test_add_func ("/fwupd/engine{device-priority}", fu_engine_device_priority_func);
g_test_add_func ("/fwupd/engine{install-duration}", fu_engine_install_duration_func);
--
2.21.0

View File

@ -31,11 +31,14 @@
Summary: Firmware update daemon
Name: fwupd
Version: 1.2.7
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+
URL: https://github.com/hughsie/fwupd
Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz
# revert broken functionality
Patch0: 0001-Revert-Require-force-to-install-a-release-with-a-dif.patch
BuildRequires: gettext
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: libxmlb-devel >= %{libxmlb_version}
@ -339,6 +342,9 @@ mkdir -p --mode=0700 $RPM_BUILD_ROOT%{_localstatedir}/lib/fwupd/gnupg
%config(noreplace)%{_sysconfdir}/fwupd/remotes.d/fwupd-tests.conf
%changelog
* Wed Apr 17 2019 Richard Hughes <richard@hughsie.com> 1.2.7-3
- Revert a patch from upstream that was causing problems with Dell hardware
* Tue Apr 16 2019 Adam Williamson <awilliam@redhat.com> - 1.2.7-2
- Rebuild with Meson fix for #1699099