chiark / gitweb /
Merge branch 'test-updates-and-related-bug-fixes' into 'master'
authorCiaran Gultnieks <ciaran@ciarang.com>
Thu, 5 Jun 2014 15:51:24 +0000 (15:51 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Thu, 5 Jun 2014 15:51:24 +0000 (15:51 +0000)
Test updates and related bug fixes

I just set up some big tests of generating repos based on feeding as many random APKs into `fdroid update` as possible.  On our jenkins server, the tests copy all of the APKs that the jenkins server has generated and builds a repo from them.  This process caught lots of little glitches in the whole process.  While these little glitches are usually caused by problematic APKs, `fdroid update` should handle them gracefully.  Hopefully this set of fixes accomplishes that.

1  2 
fdroidserver/common.py

diff --combined fdroidserver/common.py
index 443f6758fae09896a2f89b4e06e57edea5c31c9f,81675657a8401bd1bc893a7a79146b8018075134..53febdf06c023589949ddca52df356ae56e22fbb
@@@ -144,6 -144,23 +144,23 @@@ def test_sdk_exists(c)
      return True
  
  
+ def test_build_tools_exists(c):
+     if not test_sdk_exists(c):
+         return False
+     build_tools = os.path.join(c['sdk_path'], 'build-tools')
+     versioned_build_tools = os.path.join(build_tools, c['build_tools'])
+     if not os.path.isdir(versioned_build_tools):
+         logging.critical('Android Build Tools path "'
+                          + versioned_build_tools + '" does not exist!')
+         return False
+     if not os.path.exists(os.path.join(c['sdk_path'], 'build-tools', c['build_tools'], 'aapt')):
+         logging.critical('Android Build Tools "'
+                          + versioned_build_tools
+                          + '" does not contain "aapt"!')
+         return False
+     return True
  def write_password_file(pwtype, password=None):
      '''
      writes out passwords to a protected file instead of passing passwords as
@@@ -1514,7 -1531,7 +1531,7 @@@ def SilentPopen(commands, cwd=None, she
      return FDroidPopen(commands, cwd=cwd, shell=shell, output=False)
  
  
- def FDroidPopen(commands, cwd=None, shell=False, output=True):
+ def FDroidPopen(commands, cwd=None, shell=False, output=False):
      """
      Run a command and capture the possibly huge output.
  
      while not stdout_reader.eof():
          while not stdout_queue.empty():
              line = stdout_queue.get()
-             if output and options.verbose:
+             if output or options.verbose:
                  # Output directly to console
                  sys.stdout.write(line)
                  sys.stdout.flush()
@@@ -1559,7 -1576,7 +1576,7 @@@ def remove_signing_keys(build_dir)
      signing_configs = re.compile(r'^[\t ]*signingConfigs[ \t]*{[ \t]*$')
      line_matches = [
          re.compile(r'^[\t ]*signingConfig [^ ]*$'),
 -        re.compile(r'.*android\.signingConfigs\..*'),
 +        re.compile(r'.*android\.signingConfigs\.[^{]*$'),
          re.compile(r'.*variant\.outputFile = .*'),
          re.compile(r'.*\.readLine\(.*'),
          ]