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" ''; });