From f16f8a43135c72f0dc538ad7839c0db4bf991e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 20:30:21 +0100 Subject: [PATCH 1/5] Read output queues a bit more often --- fdroidserver/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index d3b42a1e..5f1f34bd 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1891,7 +1891,7 @@ def FDroidPopen(commands, cwd, sys.stderr.write(line) sys.stderr.flush() result.stderr += line - time.sleep(0.5) + time.sleep(0.2) p.communicate() result.returncode = p.returncode From 4db24c43f2e22fa776f62d9403c16c832b592995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 20:33:44 +0100 Subject: [PATCH 2/5] Android sdk from 22.2.1 to 22.3 --- buildserver/cookbooks/android-sdk/recipes/default.rb | 2 +- makebuildserver.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildserver/cookbooks/android-sdk/recipes/default.rb b/buildserver/cookbooks/android-sdk/recipes/default.rb index 0b8e1a4e..56a141ed 100644 --- a/buildserver/cookbooks/android-sdk/recipes/default.rb +++ b/buildserver/cookbooks/android-sdk/recipes/default.rb @@ -8,7 +8,7 @@ script "setup-android-sdk" do user user cwd "/tmp" code " - tar zxvf /vagrant/cache/android-sdk_r22.2.1-linux.tgz + tar zxvf /vagrant/cache/android-sdk_r22.3-linux.tgz mv android-sdk-linux #{sdk_loc} #{sdk_loc}/tools/android update sdk --no-ui -t platform-tool #{sdk_loc}/tools/android update sdk --no-ui -t tool diff --git a/makebuildserver.py b/makebuildserver.py index 6752cb9c..1075d1de 100755 --- a/makebuildserver.py +++ b/makebuildserver.py @@ -61,9 +61,9 @@ cachedir = os.path.join('buildserver', 'cache') if not os.path.exists(cachedir): os.mkdir(cachedir) cachefiles = [ - ('android-sdk_r22.2.1-linux.tgz', - 'http://dl.google.com/android/android-sdk_r22.2.1-linux.tgz', - '17ea4610008985eb1454b3b25ad00c59300cee3141f7ea3deec98f45d862faa5'), + ('android-sdk_r22.3-linux.tgz', + 'http://dl.google.com/android/android-sdk_r22.3-linux.tgz', + '4077575c98075480e0156c10e48a1521e31c7952768271a206870e6813057f4f'), ('gradle-1.8-bin.zip', 'http://services.gradle.org/distributions/gradle-1.8-bin.zip', 'a342bbfa15fd18e2482287da4959588f45a41b60910970a16e6d97959aea5703')] From 7f43797a645c719a958ab85e48ea06b603ea5c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 20:35:45 +0100 Subject: [PATCH 3/5] Add android-19 platform --- buildserver/cookbooks/android-sdk/recipes/default.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildserver/cookbooks/android-sdk/recipes/default.rb b/buildserver/cookbooks/android-sdk/recipes/default.rb index 56a141ed..a50848e0 100644 --- a/buildserver/cookbooks/android-sdk/recipes/default.rb +++ b/buildserver/cookbooks/android-sdk/recipes/default.rb @@ -72,7 +72,8 @@ X end %w{android-3 android-4 android-7 android-8 android-10 android-11 - android-12 android-13 android-14 android-15 android-16 android-17 android-18 + android-12 android-13 android-14 android-15 android-16 android-17 + android-18 android-19 extra-android-support extra-android-m2repository}.each do |sdk| script "add_sdk_#{sdk}" do From 8bab7a06ce1f5703f3885a949c877f222c6965f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 22:01:50 +0100 Subject: [PATCH 4/5] Fix: use -cp (classpath) to fix problems with java getsig --- fdroidserver/update.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 38dcdeb7..600c159a 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -385,10 +385,8 @@ def scan_apks(apps, apkcache, repodir, knownapks): thisinfo['sha256'] = sha.hexdigest() # Get the signature (or md5 of, to be precise)... - p = subprocess.Popen(['java', 'getsig', - os.path.join(os.getcwd(), apkfile)], - cwd=os.path.join(os.path.dirname(__file__), 'getsig'), - stdout=subprocess.PIPE) + p = subprocess.Popen(['java', '-cp', os.path.join(os.path.dirname(__file__), 'getsig'), + 'getsig', os.path.join(os.getcwd(), apkfile)], stdout=subprocess.PIPE) output = p.communicate()[0] if options.verbose: print output From e069da3562a05e2cf3956ea2388f3fd8ba08a84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 22:14:32 +0100 Subject: [PATCH 5/5] Don't accept empty icons; Don't add xml element if none is present --- fdroidserver/update.py | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 600c159a..a8cd1d79 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -296,7 +296,7 @@ def scan_apks(apps, apkcache, repodir, knownapks): vercode_pat = re.compile(".*versionCode='([0-9]*)'.*") vername_pat = re.compile(".*versionName='([^']*)'.*") label_pat = re.compile(".*label='(.*?)'(\n| [a-z]*?=).*") - icon_pat = re.compile(".*icon='([^']*)'.*") + icon_pat = re.compile(".*icon='([^']+?)'.*") sdkversion_pat = re.compile(".*'([0-9]*)'.*") string_pat = re.compile(".*'([^']*)'.*") for apkfile in glob.glob(os.path.join(repodir, '*.apk')): @@ -344,7 +344,9 @@ def scan_apks(apps, apkcache, repodir, knownapks): sys.exit(1) elif line.startswith("application:"): thisinfo['name'] = re.match(label_pat, line).group(1) - thisinfo['iconsrc'] = re.match(icon_pat, line).group(1) + match = re.match(icon_pat, line) + if match: + thisinfo['iconsrc'] = match.group(1) elif line.startswith("sdkVersion:"): thisinfo['sdkversion'] = re.match(sdkversion_pat, line).group(1) elif line.startswith("native-code:"): @@ -396,19 +398,20 @@ def scan_apks(apps, apkcache, repodir, knownapks): thisinfo['sig'] = output[7:].strip() # Extract the icon file... - apk = zipfile.ZipFile(apkfile, 'r') - thisinfo['icon'] = (thisinfo['id'] + '.' + - str(thisinfo['versioncode']) + '.png') - iconpath = os.path.join(icon_dir, thisinfo['icon']) - try: - iconfile = open(iconpath, 'wb') - iconfile.write(apk.read(thisinfo['iconsrc'])) - iconfile.close() - except: - print "WARNING: Error retrieving icon file" - apk.close() + if 'iconsrc' in thisinfo: + apk = zipfile.ZipFile(apkfile, 'r') + thisinfo['icon'] = (thisinfo['id'] + '.' + + str(thisinfo['versioncode']) + '.png') + iconpath = os.path.join(icon_dir, thisinfo['icon']) + try: + iconfile = open(iconpath, 'wb') + iconfile.write(apk.read(thisinfo['iconsrc'])) + iconfile.close() + except: + print "WARNING: Error retrieving icon file" + apk.close() - resize_icon(iconpath) + resize_icon(iconpath) # Record in known apks, getting the added date at the same time.. added = knownapks.recordapk(thisinfo['apkname'], thisinfo['id']) @@ -516,7 +519,8 @@ def make_index(apps, apks, repodir, archive, categories): addElement('lastupdated', time.strftime('%Y-%m-%d', app['lastupdated']), doc, apel) addElement('name', app['Name'], doc, apel) addElement('summary', app['Summary'], doc, apel) - addElement('icon', app['icon'], doc, apel) + if app['icon'] is not None: + addElement('icon', app['icon'], doc, apel) def linkres(link): for app in apps: if app['id'] == link: @@ -785,13 +789,13 @@ def main(): if bestver == 0: if app['Name'] is None: app['Name'] = app['id'] - app['icon'] = '' + app['icon'] = None if app['Disabled'] is None: print "WARNING: Application " + app['id'] + " has no packages" else: if app['Name'] is None: app['Name'] = bestapk['name'] - app['icon'] = bestapk['icon'] + app['icon'] = bestapk['icon'] if 'icon' in bestapk else None # Sort the app list by name, then the web site doesn't have to by default. # (we had to wait until we'd scanned the apks to do this, because mostly the @@ -851,7 +855,8 @@ def main(): for app in apps: if app['id'] == appid: data += app['Name'] + "\t" - data += app['icon'] + "\t" + if app['icon'] is not None: + data += app['icon'] + "\t" data += app['License'] + "\n" break f = open(os.path.join(repodirs[0], 'latestapps.dat'), 'w')