From 05eb1c38a06cf95daa09a12c4cff845d9007e987 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 22 Jun 2022 01:17:02 -0700 Subject: [PATCH] Changed updater script to handle new version strings New version strings are in a different place, and Sparkle will no longer be including the Git hash in the CFBundleVersion query, so we must get it from the ZIP filename. --- Scripts/update_feed.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Scripts/update_feed.rb b/Scripts/update_feed.rb index 23fd49863..9e21cdf21 100755 --- a/Scripts/update_feed.rb +++ b/Scripts/update_feed.rb @@ -24,15 +24,14 @@ sortedchannels = channel.search('./item').sort_by{ |i| Time.parse(i.at('pubDate' #Get the latest revision from the appcast appcast_enclosure = sortedchannels[0].search('./enclosure').first -appcast_revision = sortedchannels[0].xpath('.//sparkle:version').text -appcast_url = appcast_enclosure.attribute('url'); -if !appcast_revision - appcast_revision = appcast_enclosure.attribute_with_ns('version', sparkle).to_s -end -appcast_revision_split = appcast_revision.split( /-/ ) -appcast_revision_code = appcast_revision_split[1] -appcast_revision_split = appcast_revision_code.split( /g/ ) -appcast_revision_code = appcast_revision_split[1] +appcast_url = appcast_enclosure.attribute('url').to_s; + +appcast_filename = appcast_url.split( '/' )[-1] +appcast_filename_split = appcast_filename.split( '.' ) +appcast_filename_base = appcast_filename_split[0] +appcast_filename_split = appcast_filename_base.split( '-' ) + +appcast_revision_code = appcast_filename_split[1] #Remove modified files that may cause conflicts. #%x[hg revert --all] @@ -60,6 +59,11 @@ appcast_revision_code = appcast_revision_split[1] latest_revision = version_element.inner_text + if latest_revision.split( /-/ ).count < 2 + version_element = plistdoc.xpath('//key[.="GitVersion"]/following-sibling::string[1]') + latest_revision = version_element.inner_text + end + #latest_revision = %x[/usr/local/bin/hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'] revision_split = latest_revision.split( /-/ ) revision_number = revision_split[0]