chiark / gitweb /
Merge branch 'master' into verbose-rewrite
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 3 Nov 2013 13:00:09 +0000 (14:00 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 3 Nov 2013 13:00:09 +0000 (14:00 +0100)
Conflicts:
fdroidserver/common.py

1  2 
fdroidserver/checkupdates.py
fdroidserver/common.py

Simple merge
index 174878d1230ee0f1463a17591e4d062e22907493,9364d70f9b18032e29a049be362d1eac150c6b50..5845ecc5067f2cd1569fad7cda8ec22d50c1ddda
@@@ -1387,7 -1372,22 +1388,22 @@@ def prepare_source(vcs, app, build, bui
          if 'target' in build:
              parms.append('-t')
              parms.append(build['target'])
-         update_dirs = [d.strip() for d in updatemode.split(';')]
+         update_dirs = None
+         if updatemode == 'auto':
+             update_dirs = ['.']
+             with open(os.path.join(root_dir, 'project.properties')) as f:
+                 for line in f.readlines():
+                     if not line.startswith('android.library.reference.'):
+                         continue
+                     path = line.split('=')[1].strip()
+                     relpath = os.path.join(root_dir, path)
+                     if not os.path.isdir(relpath):
+                         continue
 -                    if verbose:
++                    if options.verbose:
+                         print "Found subproject %s..." % path
+                     update_dirs.append(path)
+         else:
+             update_dirs = [d.strip() for d in updatemode.split(';')]
          # Force build.xml update if necessary...
          if updatemode == 'force' or 'target' in build:
              if updatemode == 'force':
                  if os.path.exists(badpath):
                      print "Removing '%s'" % badpath
                      shutil.rmtree(badpath)
 -            if verbose:
+             dparms = parms + ['-p', d]
-                 print "Update of '%s': exec '%s' in '%s'"%\
-                     (d," ".join(parms),cwd)
-             p = FDroidPopen(parms, cwd=cwd)
 +            if options.verbose:
 -            p = FDroidPopen(dparms, cwd=root_dir, verbose=verbose)
+                 if d == '.':
+                     print "Updating main project..."
+                 else:
+                     print "Updating subproject %s..." % d
++            p = FDroidPopen(dparms, cwd=root_dir)
              # check to see whether an error was returned without a proper exit code (this is the case for the 'no target set or target invalid' error)
              if p.returncode != 0 or (p.stderr != "" and p.stderr.startswith("Error: ")):
-                 raise BuildException("Failed to update project at %s" % cwd,
+                 raise BuildException("Failed to update project at %s" % d,
                          p.stdout, p.stderr)
  
      # If the app has ant set up to sign the release, we need to switch