the latter, the repo URL must encode the path to the trunk and tags or else no
tags will be found.
@item
-@code{HTTP} - An HTTP request is performed, and the resulting document is
-scanned for two regular expressions, the first specifying the version name
-and the second the version code. The expression for the version name can be
-blank, but the version code must always be correct.
-
-The @code{Update Check Data} field is used to provide the url and the two
-regular expressions, in the form @code{url|ex1|ex2}.
+@code{HTTP} - HTTP requests are used to determine the current version code and
+version name. This is controlled by the @code{Update Check Data} field, which
+is of the form @code{urlcode|excode|urlver|exver}.
+
+Firstly, if @code{urlcode} is non-empty, the document from that URL is
+retrieved, and matched against the regular expression @code{excode}, with the
+first group becoming the version code.
+
+Secondly, if @code{urlver} is non-empty, the document from that URL is
+retrieved, and matched against the regular expression @code{exver}, with the
+first group becoming the version name. The @code{urlver} field can be set to
+simply '.' which says to use the same document returned for the version code
+again, rather than retrieving a different one.
@end itemize
@node Update Check Data
if not 'Update Check Data' in app:
raise Exception('Missing Update Check Data')
- url, verex, codeex = app['Update Check Data'].split('|')
+ urlcode, codeex, urlver, verex = app['Update Check Data'].split('|')
- req = urllib2.Request(url, None)
- resp = urllib2.urlopen(req, None, 20)
- page = resp.read()
-
- if len(verex) > 0:
- m = re.search(verex, page)
- if not m:
- raise Exception("No RE match for version")
- version = m.group(1)
- else:
- version = "??"
+ vercode = "99999999"
+ if len(urlcode) > 0:
+ req = urllib2.Request(urlcode, None)
+ resp = urllib2.urlopen(req, None, 20)
+ page = resp.read()
- if len(codeex) > 0:
m = re.search(codeex, page)
if not m:
raise Exception("No RE match for version code")
vercode = m.group(1)
- else:
- vercode = "99999999"
+
+ version = "??"
+ if len(urlver) > 0:
+ if urlver != '.':
+ req = urllib2.Request(urlver, None)
+ resp = urllib2.urlopen(req, None, 20)
+ page = resp.read()
+
+ m = re.search(verex, page)
+ if not m:
+ raise Exception("No RE match for version")
+ version = m.group(1)
return (version, vercode)