TaylorMonacelli
TaylorMonacelli

Reputation: 353

Is the purpose of the Appcast element pubDate in the Sparkle update framework to enable holding off an update until the some desired publish date?

I was hoping that the appcast pubDate xml element would allow me to specify that my app cannot be considered for update unless the current date is the publish date (pubDate) or later.

Here's a sample appcast that includes the pubDate element inside the item element:

<item>
  <title>Version 2.0 (2 bugs fixed; 3 new features)</title>
  <sparkle:releaseNotesLink>http://you.com/app/2.0.html</sparkle:releaseNotesLink>
  <pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
  <enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
</item>

which was copied from Sparkle's site here: https://github.com/sparkle-project/Sparkle/blob/0ed83cf9f2eeb425d4fdd141c01a29d843970c20/Sample%20Appcast.xml

So the sequence is this:

  1. I copy my updated app--myapp v1.1--to my update web server on Monday
  2. on my update server, I also set the pubDate to Wednesday (in the proper RFC 822 format)
  3. on Tuesday, someone runs myapp v1.0 and tries to update myapp to whatever is available using sparkle appcast bundled inside myapp v1.0
  4. at that point, sparkle compares the version and sees that an update should happen, but its still only Tuesday so sparkle doesn't give the option to update until he tries again on Wednesday (or later)
  5. Wednesday arrives and user attempts to update myapp v1.0 again and this time it works because version is updatable and date is wednesday.

Is that the purpose of the pubDate Sparkle element?

Does Sparkle use the pubDate to help determine whether an update should happen or not in addition to the version number?

Holding an app back from updating until some date is what I want, but I'm finding that pubDate doesn't seem to do that for me.

I couldn't find reference to the purpose of the pubDate in Sparkle docs: https://github.com/sparkle-project/Sparkle/wiki

Upvotes: 1

Views: 709

Answers (1)

Mangled Deutz
Mangled Deutz

Reputation: 11413

Sparkle uses RSS, as you know, to list application updates inside enclosure tags (this is what they call "appcasting" - see: http://connectedflow.com/appcasting/)

The pubDate element is not specific to Sparkle - it's just a part of the RSS spec (see http://www.w3schools.com/rss/rss_tag_pubdate.asp ), and may/should be used by generic rss readers to present items/entries chronologically.

By itself, Sparkle does only one thing with pubDate as far as I can tell - and it's ordering update candidates (https://github.com/sparkle-project/Sparkle/blob/master/SUAppcast.m#L218)

Now, you can further customize the way Sparkle selects eligible updates by subclassing SUUpdater: see https://github.com/sparkle-project/Sparkle/wiki/bundles#wiki-subclassing-suupdater and especially the bestValidUpdateInAppcast method: https://github.com/sparkle-project/Sparkle/wiki/customization

There, you should be able to further process items and achieve the behavior you have in mind.

Upvotes: 1

Related Questions