git.iko.soy/typeable/nixpkgs
on master help sign in
sublime3{,-dev}: fix updateScript

The HTML page changed and the update script was no longer finding the latest version. I changed it to query for the latest version using dedicated URL: https://forum.sublimetext.com/t/fixed-download-url-for-latest-version/23763/7 Also terminated the update sooner if we detect no update available. update-source-version handles that normally but we are cleaning the version so that we can update both platforms at the same time.

commit794a08ca8ed50bc1189f5996c51891a3a50af98a authorJan Tojnar <jtojnar@gmail.com> dateThu 14 May 2020, 08:37 (7 years ago) parenta33eb1a
1 file changed+7−2
pkgs/applications/editors/sublime/3/common.nix+7−2
pkgs/applications/editors/sublime/3/common.nix+7−2
@@ -13,7 +13,7 @@ let
1313 primaryBinary = "sublime_text";
1414 primaryBinaryAliases = [ "subl" "sublime" "sublime3" ];
1515 downloadUrl = "https://download.sublimetext.com/sublime_text_3_build_${buildVersion}_${arch}.tar.bz2";
16− versionUrl = "https://www.sublimetext.com/${if dev then "3dev" else "3"}";
16+ versionUrl = "https://download.sublimetext.com/latest/${if dev then "dev" else "stable"}";
1717 versionFile = builtins.toString ./packages.nix;
1818 archSha256 =
1919 if stdenv.hostPlatform.system == "i686-linux" then
@@ -133,7 +133,12 @@ in stdenv.mkDerivation (rec {
133133 set -o errexit
134134 PATH=${stdenv.lib.makeBinPath [ common-updater-scripts curl gnugrep ]}
135135
136− latestVersion=$(curl -s ${versionUrl} | grep -Po '(?<=<p class="latest"><i>Version:</i> Build )([0-9]+)')
136+ latestVersion=$(curl -s ${versionUrl})
137+
138+ if [[ "${buildVersion}" = "$latestVersion" ]]; then
139+ echo "The new version same as the old version."
140+ exit 0
141+ fi
137142
138143 for platform in ${stdenv.lib.concatStringsSep " " meta.platforms}; do
139144 # The script will not perform an update when the version attribute is up to date from previous platform run