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

Get rid of more unnecessary finds

This commit is contained in:
Daniel Martí 2013-12-20 09:42:10 +01:00
parent efc8317272
commit 99b5d5e387
3 changed files with 9 additions and 7 deletions

View File

@ -94,11 +94,11 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
p = subprocess.Popen(['VBoxManage', 'snapshot', get_builder_vm_id(), 'list', '--details'],
cwd='builder', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
if output.find('fdroidclean') != -1:
if 'fdroidclean' in output:
if options.verbose:
print "...snapshot exists - resetting build server to clean state"
retcode, output = vagrant(['status'], cwd='builder')
if output.find('running') != -1:
if 'running' in output:
if options.verbose:
print "...suspending"
vagrant(['suspend'], cwd='builder')
@ -186,7 +186,7 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
p = subprocess.Popen(['VBoxManage', 'snapshot', get_builder_vm_id(), 'list', '--details'],
cwd='builder', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
if output.find('fdroidclean') == -1:
if 'fdroidclean' not in output:
raise BuildException("Failed to take snapshot.")
try:

View File

@ -31,6 +31,7 @@ from distutils.version import LooseVersion
import common, metadata
from common import BuildException
from common import VCSException
from metadata import MetaDataException
# Check for a new version by looking at a document retrieved via HTTP.
@ -413,9 +414,10 @@ def main():
elif mode.startswith('Version '):
pattern = mode[8:]
if pattern.startswith('+'):
o = pattern.find(' ')
suffix = pattern[1:o]
pattern = pattern[o + 1:]
try:
suffix, pattern = pattern.split(' ', 1)
except ValueError:
raise MetaDataException("Invalid AUM at: " + line)
else:
suffix = ''
gotcur = False

View File

@ -307,7 +307,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
for apkfile in glob.glob(os.path.join(repodir, '*.apk')):
apkfilename = apkfile[len(repodir) + 1:]
if apkfilename.find(' ') != -1:
if ' ' in apkfilename:
print "No spaces in APK filenames!"
sys.exit(1)