diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 2a6f26ec..3d718de9 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -119,7 +119,8 @@ def check_tags(app, sdk_path): paths = common.manifest_paths(build_dir, flavour) version, vercode, package = common.parse_androidmanifests(paths) if package and package == app['id'] and version and vercode: - print "Manifest exists. Found version %s" % version + print "Manifest exists. Found version %s (%s)" % ( + version, vercode) if int(vercode) > int(hcode): htag = tag hcode = str(int(vercode)) @@ -334,6 +335,7 @@ def main(): tag = None msg = None + vercode = None mode = app['Update Check Mode'] if mode == 'Tags': (version, vercode, tag) = check_tags(app, config['sdk_path']) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index ee5a3513..c1e49470 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -385,7 +385,7 @@ class vcs_hg(vcs): if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0: raise VCSException("Hg clone failed") else: - if subprocess.call('hg status -u | xargs rm -rf', + if subprocess.call('hg status -uS | xargs rm -rf', cwd=self.local, shell=True) != 0: raise VCSException("Hg clean failed") if not self.refreshed: @@ -395,11 +395,11 @@ class vcs_hg(vcs): self.refreshed = True rev = str(rev if rev else 'default') - if rev: - revargs = [rev] - if subprocess.call(['hg', 'checkout', '-C'] + revargs, - cwd=self.local) != 0: - raise VCSException("Hg checkout failed") + if not rev: + return + if subprocess.call(['hg', 'update', '-C', rev], + cwd=self.local) != 0: + raise VCSException("Hg checkout failed") def gettags(self): p = subprocess.Popen(['hg', 'tags', '-q'], @@ -1111,7 +1111,7 @@ def parse_androidmanifests(paths): vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search psearch = re.compile(r'.*package="([^"]+)".*').search - vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?).*').search + vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?)[^\d].*').search vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search