arc-browser: use `xmlstartlet` for `passthru.updateScript`, 1.101.0-64746 -> 1.106.0-66192 (#422767)

authored by Peder Bergebakken Sundt and committed by GitHub 2a23638b 429c26ac

+11 -8
+11 -8
pkgs/by-name/ar/arc-browser/package.nix
··· 6 6 writeShellApplication, 7 7 curl, 8 8 common-updater-scripts, 9 + xmlstarlet, 9 10 }: 10 11 11 12 stdenvNoCC.mkDerivation (finalAttrs: { 12 13 pname = "arc-browser"; 13 - version = "1.101.0-64746"; 14 + version = "1.106.0-66192"; 14 15 15 16 src = fetchurl { 16 17 url = "https://releases.arc.net/release/Arc-${finalAttrs.version}.dmg"; 17 - hash = "sha256-u391hQB+Fqw21cu9GQglOkPHie+8uK8FTxSLWLAH0eA="; 18 + hash = "sha256-AlM0wJ/2okrxw2ZpMPodlSVQaMMkBPf5iIN4bnMTaME="; 18 19 }; 19 20 20 21 nativeBuildInputs = [ undmg ]; ··· 37 38 runtimeInputs = [ 38 39 curl 39 40 common-updater-scripts 41 + xmlstarlet 40 42 ]; 41 43 text = '' 42 - redirect_url="$(curl -s -L -f "https://releases.arc.net/release/Arc-latest.dmg" -o /dev/null -w '%{url_effective}')" 43 - # The url scheme is: https://releases.arc.net/release/Arc-1.23.4-56789.dmg 44 - # We strip everything before 'Arc-' and after '.dmg' 45 - version="''${redirect_url##*/Arc-}" 46 - version="''${version%.dmg}" 47 - update-source-version arc-browser "$version" --file=./pkgs/by-name/ar/arc-browser/package.nix 44 + 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)" 45 + version_part="''${latest_version_string%% (*}" 46 + build_part="''${latest_version_string##*\(}" 47 + build_part="''${build_part%\)*}" 48 + version="''${version_part}-''${build_part}" 49 + 50 + update-source-version arc-browser "$version" 48 51 ''; 49 52 }); 50 53