chiark / gitweb /
A couple of minor import improvements
authorCiaran Gultnieks <ciaran@ciarang.com>
Wed, 30 Oct 2013 08:05:02 +0000 (08:05 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Wed, 30 Oct 2013 09:51:33 +0000 (09:51 +0000)
fdroidserver/import.py

index a123193e0a0fc7aca70a2b3fdacc0e906d884a0c..8ca261f545dc1794f7dd3ffd2b72b0ab248e172f 100644 (file)
@@ -98,6 +98,8 @@ def main():
                       help="Path to main android project subdirectory, if not in root.")
     parser.add_option("-r", "--repo", default=None,
                       help="Allows a different repo to be specified for a multi-repo google code project")
+    parser.add_option("--rev", default=None,
+                      help="Allows a different revision (or git branch) to be specified for the initial import")
     (options, args) = parser.parse_args()
 
     if not options.url:
@@ -218,7 +220,7 @@ def main():
     if os.path.exists(src_dir):
         shutil.rmtree(src_dir)
     vcs = common.getvcs(repotype, repo, src_dir, sdk_path)
-    vcs.gotorevision(None)
+    vcs.gotorevision(options.rev)
     if options.subdir:
         root_dir = os.path.join(src_dir, options.subdir)
     else:
@@ -236,11 +238,9 @@ def main():
         print "Couldn't find package ID"
         sys.exit(1)
     if not version:
-        print "Couldn't find latest version name"
-        sys.exit(1)
+        print "WARNING: Couldn't find latest version name"
     if not vercode:
-        print "Couldn't find latest version code"
-        sys.exit(1)
+        print "WARNING: Couldn't find latest version code"
 
     # Make sure it's actually new...
     for app in apps:
@@ -262,16 +262,15 @@ def main():
 
     # Create a build line...
     build = {}
-    build['version'] = version
-    build['vercode'] = vercode
+    build['version'] = version if version else '?'
+    build['vercode'] = vercode if vercode else '?'
     build['commit'] = '?'
+    build['disable'] = 'Generated by import.py - check/set version fields and commit id'
     if options.subdir:
         build['subdir'] = options.subdir
     if os.path.exists(os.path.join(root_dir, 'jni')):
         build['buildjni'] = 'yes'
     app['builds'].append(build)
-    app['comments'].append(('build:' + version,
-        "#Generated by import.py - check this is the right version, and find the right commit!"))
 
     # Keep the repo directory to save bandwidth...
     if not os.path.exists('build'):