From 51d4adf6c8fe74e6b95083019187f7b644db9dc8 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sat, 5 Jul 2025 21:32:54 +0300 Subject: [PATCH] arc-browser: use `xmlstartlet` for `passthru.updateScript` --- pkgs/by-name/ar/arc-browser/package.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ar/arc-browser/package.nix b/pkgs/by-name/ar/arc-browser/package.nix index ebe4fc34719f..e365130286dd 100644 --- a/pkgs/by-name/ar/arc-browser/package.nix +++ b/pkgs/by-name/ar/arc-browser/package.nix @@ -6,6 +6,7 @@ writeShellApplication, curl, common-updater-scripts, + xmlstarlet, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -37,14 +38,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { runtimeInputs = [ curl common-updater-scripts + xmlstarlet ]; text = '' - redirect_url="$(curl -s -L -f "https://releases.arc.net/release/Arc-latest.dmg" -o /dev/null -w '%{url_effective}')" - # The url scheme is: https://releases.arc.net/release/Arc-1.23.4-56789.dmg - # We strip everything before 'Arc-' and after '.dmg' - version="''${redirect_url##*/Arc-}" - version="''${version%.dmg}" - update-source-version arc-browser "$version" --file=./pkgs/by-name/ar/arc-browser/package.nix + latest_version_string="$(curl -s "https://releases.arc.net/updates.xml" | xmlstarlet sel -N sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" -t -v "//item[1]/sparkle:shortVersionString" -n)" + version_part="''${latest_version_string%% (*}" + build_part="''${latest_version_string##*\(}" + build_part="''${build_part%\)*}" + version="''${version_part}-''${build_part}" + + update-source-version arc-browser "$version" ''; });