From 8ceb474b28feab75aa591a3e26403e90a3e8fdc3 Mon Sep 17 00:00:00 2001 From: Eric Oestrich Date: Mon, 24 Jun 2024 12:14:13 -0400 Subject: [PATCH] Fix regression that prevents using fwup public keys Commit 3275db2e added an empty list pattern match that would fail when a key was present. Fix issue by removing the match. --- lib/nerves_hub_link/update_manager.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nerves_hub_link/update_manager.ex b/lib/nerves_hub_link/update_manager.ex index a215dbf..ccb000e 100644 --- a/lib/nerves_hub_link/update_manager.ex +++ b/lib/nerves_hub_link/update_manager.ex @@ -226,7 +226,7 @@ defmodule NervesHubLink.UpdateManager do end @spec start_fwup_stream(UpdateInfo.t(), [binary()], State.t()) :: State.t() - defp start_fwup_stream(%UpdateInfo{} = update_info, [] = fwup_public_keys, state) do + defp start_fwup_stream(%UpdateInfo{} = update_info, fwup_public_keys, state) do pid = self() fun = &report_download(pid, &1) {:ok, download} = Downloader.start_download(update_info.firmware_url, fun) @@ -249,7 +249,7 @@ defmodule NervesHubLink.UpdateManager do end @spec fwup_args(FwupConfig.t(), list(String.t())) :: [String.t()] - defp fwup_args(%FwupConfig{} = config, [] = fwup_public_keys) do + defp fwup_args(%FwupConfig{} = config, fwup_public_keys) do args = ["--apply", "--no-unmount", "-d", config.fwup_devpath, "--task", config.fwup_task] Enum.reduce(fwup_public_keys, args, fn public_key, args ->