From d6dbad65c660a3d358a06646e39c49ed64e95b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 23 Jan 2014 10:54:32 +0100 Subject: [PATCH 1/5] Don't run lint on disabled apps --- fdroidserver/lint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 501532fd..1142818a 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -80,6 +80,9 @@ def main(): appid = app['id'] lastcommit = '' + if app['Disabled']: + continue + for build in app['builds']: if 'commit' in build and 'disable' not in build: lastcommit = build['commit'] From 15c0a2779af22d3263e90cfa9108f162a219b1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=A3=D8=AD=D9=85=D8=AF=20=D8=A7=D9=84=D9=85=D8=AD=D9=85?= =?UTF-8?q?=D9=88=D8=AF=D9=8A=20=28Ahmed=20El-Mahmoudy=29?= Date: Fri, 24 Jan 2014 10:47:57 +0200 Subject: [PATCH 2/5] git-svn: Support / in commit field commit= is still supported --- fdroidserver/common.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 2cc1bf1f..27078ade 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -454,7 +454,16 @@ class vcs_gitsvn(vcs): else: # No tag found, normal svn rev translation # Translate svn rev into git format - p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + rev], + rev_split=rev.split('/') + if len(rev_split) > 1: + treeish=rev_split[0] + svn_rev=rev_split[1] + else: + # if no branch is specified, then assume trunk (ie. 'master' + # branch): + treeish='master' + svn_rev=rev + p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + svn_rev, treeish], cwd=self.local, stdout=subprocess.PIPE) git_rev = p.communicate()[0].rstrip() if p.returncode != 0 or not git_rev: From 325cca0e378a4b50577f2d047cad969998b167b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 24 Jan 2014 10:10:40 +0100 Subject: [PATCH 3/5] Indent properly, space the code a bit --- fdroidserver/common.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 27078ade..4d1f50eb 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -454,18 +454,21 @@ class vcs_gitsvn(vcs): else: # No tag found, normal svn rev translation # Translate svn rev into git format - rev_split=rev.split('/') + rev_split = rev.split('/') if len(rev_split) > 1: - treeish=rev_split[0] - svn_rev=rev_split[1] + treeish = rev_split[0] + svn_rev = rev_split[1] + else: - # if no branch is specified, then assume trunk (ie. 'master' - # branch): - treeish='master' - svn_rev=rev + # if no branch is specified, then assume trunk (ie. 'master' + # branch): + treeish = 'master' + svn_rev = rev + p = subprocess.Popen(['git', 'svn', 'find-rev', 'r' + svn_rev, treeish], cwd=self.local, stdout=subprocess.PIPE) git_rev = p.communicate()[0].rstrip() + if p.returncode != 0 or not git_rev: # Try a plain git checkout as a last resort p = subprocess.Popen(['git', 'checkout', rev], cwd=self.local, @@ -484,6 +487,7 @@ class vcs_gitsvn(vcs): print out else: raise VCSException("Git svn checkout failed") + # Get rid of any uncontrolled files left behind... if subprocess.call(['git', 'clean', '-dffx'], cwd=self.local) != 0: raise VCSException("Git clean failed") From 83c3a8b68ed178b5d47d506c039c0a5c8cef3a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 24 Jan 2014 10:42:11 +0100 Subject: [PATCH 4/5] Easier preassemble handling --- fdroidserver/build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 79b40155..9de4d322 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -611,8 +611,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d commands = [config['gradle']] if 'preassemble' in thisbuild: - for task in thisbuild['preassemble'].split(): - commands.append(task) + commands += thisbuild['preassemble'].split() commands += ['assemble'+''.join(flavours)+'Release'] p = FDroidPopen(commands, cwd=gradle_dir) From f277ba6b334177202e5560b69ee4818332e31e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 24 Jan 2014 12:55:43 +0100 Subject: [PATCH 5/5] Avoid more possible crashes when invalid icons are present --- fdroidserver/update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index b71d9782..bf3eed32 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -532,7 +532,12 @@ def scan_apks(apps, apkcache, repodir, knownapks): get_icon_dir(repodir, last_density), iconfilename) iconpath = os.path.join( get_icon_dir(repodir, density), iconfilename) - im = Image.open(last_iconpath) + try: + im = Image.open(last_iconpath) + except: + print "WARNING: Invalid image file at %s" % last_iconpath + continue + size = dpi_to_px(density) im.thumbnail((size, size), Image.ANTIALIAS)