1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 11:00:10 +01:00

Various fixes: hg vcs updating, gradle vercode regex...

This commit is contained in:
Daniel Martí 2013-11-01 19:12:22 +01:00
parent e07d35f913
commit 5644b17048
2 changed files with 10 additions and 8 deletions

View File

@ -119,7 +119,8 @@ def check_tags(app, sdk_path):
paths = common.manifest_paths(build_dir, flavour) paths = common.manifest_paths(build_dir, flavour)
version, vercode, package = common.parse_androidmanifests(paths) version, vercode, package = common.parse_androidmanifests(paths)
if package and package == app['id'] and version and vercode: 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): if int(vercode) > int(hcode):
htag = tag htag = tag
hcode = str(int(vercode)) hcode = str(int(vercode))
@ -334,6 +335,7 @@ def main():
tag = None tag = None
msg = None msg = None
vercode = None
mode = app['Update Check Mode'] mode = app['Update Check Mode']
if mode == 'Tags': if mode == 'Tags':
(version, vercode, tag) = check_tags(app, config['sdk_path']) (version, vercode, tag) = check_tags(app, config['sdk_path'])

View File

@ -385,7 +385,7 @@ class vcs_hg(vcs):
if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0: if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0:
raise VCSException("Hg clone failed") raise VCSException("Hg clone failed")
else: 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: cwd=self.local, shell=True) != 0:
raise VCSException("Hg clean failed") raise VCSException("Hg clean failed")
if not self.refreshed: if not self.refreshed:
@ -395,11 +395,11 @@ class vcs_hg(vcs):
self.refreshed = True self.refreshed = True
rev = str(rev if rev else 'default') rev = str(rev if rev else 'default')
if rev: if not rev:
revargs = [rev] return
if subprocess.call(['hg', 'checkout', '-C'] + revargs, if subprocess.call(['hg', 'update', '-C', rev],
cwd=self.local) != 0: cwd=self.local) != 0:
raise VCSException("Hg checkout failed") raise VCSException("Hg checkout failed")
def gettags(self): def gettags(self):
p = subprocess.Popen(['hg', 'tags', '-q'], p = subprocess.Popen(['hg', 'tags', '-q'],
@ -1111,7 +1111,7 @@ def parse_androidmanifests(paths):
vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search
psearch = re.compile(r'.*package="([^"]+)".*').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 vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search
psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search