From c1020ca38f7544fa02f3d6f593aa5875ba3d2185 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Wed, 30 Oct 2013 08:05:02 +0000 Subject: [PATCH] A couple of minor import improvements --- fdroidserver/import.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fdroidserver/import.py b/fdroidserver/import.py index a123193e..8ca261f5 100644 --- a/fdroidserver/import.py +++ b/fdroidserver/import.py @@ -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'):