1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 14:30:11 +01:00

A couple of minor import improvements

This commit is contained in:
Ciaran Gultnieks 2013-10-30 08:05:02 +00:00
parent 9571c792db
commit c1020ca38f

View 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'):