summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/sublime
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2020-05-14 08:37:26 +0200
committerJan Tojnar <jtojnar@gmail.com>2020-05-14 12:08:08 +0200
commit794a08ca8ed50bc1189f5996c51891a3a50af98a (patch)
treed3050218cbf7aaeda0a54fcabc5608738bde2a03 /pkgs/applications/editors/sublime
parenta33eb1a0e45ca2c1deb616f8dc93993e8d4c819a (diff)
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.
Diffstat (limited to 'pkgs/applications/editors/sublime')
-rw-r--r--pkgs/applications/editors/sublime/3/common.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/applications/editors/sublime/3/common.nix b/pkgs/applications/editors/sublime/3/common.nix
index a75233fcf359..22c23280d17d 100644
--- a/pkgs/applications/editors/sublime/3/common.nix
+++ b/pkgs/applications/editors/sublime/3/common.nix
@@ -13,7 +13,7 @@ let
primaryBinary = "sublime_text";
primaryBinaryAliases = [ "subl" "sublime" "sublime3" ];
downloadUrl = "https://download.sublimetext.com/sublime_text_3_build_${buildVersion}_${arch}.tar.bz2";
- versionUrl = "https://www.sublimetext.com/${if dev then "3dev" else "3"}";
+ versionUrl = "https://download.sublimetext.com/latest/${if dev then "dev" else "stable"}";
versionFile = builtins.toString ./packages.nix;
archSha256 =
if stdenv.hostPlatform.system == "i686-linux" then
@@ -133,7 +133,12 @@ in stdenv.mkDerivation (rec {
set -o errexit
PATH=${stdenv.lib.makeBinPath [ common-updater-scripts curl gnugrep ]}
- latestVersion=$(curl -s ${versionUrl} | grep -Po '(?<=<p class="latest"><i>Version:</i> Build )([0-9]+)')
+ latestVersion=$(curl -s ${versionUrl})
+
+ if [[ "${buildVersion}" = "$latestVersion" ]]; then
+ echo "The new version same as the old version."
+ exit 0
+ fi
for platform in ${stdenv.lib.concatStringsSep " " meta.platforms}; do
# The script will not perform an update when the version attribute is up to date from previous platform run