chiark / gitweb /
Resolve some autoname problems
authorCiaran Gultnieks <ciaran@ciarang.com>
Fri, 14 Jun 2013 06:16:58 +0000 (07:16 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Fri, 14 Jun 2013 06:16:58 +0000 (07:16 +0100)
fdroidserver/checkupdates.py

index 6f892fe99ef88d5ca028d37878113270ef3cbfb2..d89004c6d24339a4d38e9017d41eec23446a412e 100644 (file)
@@ -268,23 +268,30 @@ def main():
             writeit = True
             logmsg = "Update current version of " + app['id'] + " to " + version
 
-        if app['Repo Type'] == 'srclib':
-            app_dir = os.path.join('build', 'srclib', app['Repo'])
-        else:
-            app_dir = os.path.join('build/', app['id'])
+        # Do the Auto Name thing...
+        if len(app["Repo Type"]) > 0:
 
-        vcs = common.getvcs(app["Repo Type"], app["Repo"], app_dir, sdk_path)
-        vcs.gotorevision(None)
+            try:
 
-        if len(app['builds']) > 0:
-            if 'subdir' in app['builds'][-1]:
-                app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])
+                if app['Repo Type'] == 'srclib':
+                    app_dir = os.path.join('build', 'srclib', app['Repo'])
+                else:
+                    app_dir = os.path.join('build/', app['id'])
+
+                vcs = common.getvcs(app["Repo Type"], app["Repo"], app_dir, sdk_path)
+                vcs.gotorevision(None)
 
-        new_name = common.fetch_real_name(app_dir)
-        if new_name != app['Auto Name']:
-            app['Auto Name'] = new_name
-            if not writeit:
-                writeit = True
+                if len(app['builds']) > 0:
+                    if 'subdir' in app['builds'][-1]:
+                        app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])
+
+                new_name = common.fetch_real_name(app_dir)
+                if new_name != app['Auto Name']:
+                    app['Auto Name'] = new_name
+                    if not writeit:
+                        writeit = True
+            except Exception:
+                msg = "Auto Name failed for  %s due to exception: %s" % (app['id'], traceback.format_exc())
 
         if options.auto:
             mode = app['Auto Update Mode']