mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-19 03:30:12 +02:00
Merge commit 'refs/merge-requests/86' of git://gitorious.org/f-droid/fdroidserver into merge-requests/86
This commit is contained in:
commit
bc4240ca30
14
fdroid
14
fdroid
@ -31,17 +31,23 @@ commands = [
|
|||||||
"stats",
|
"stats",
|
||||||
"server"]
|
"server"]
|
||||||
|
|
||||||
|
def print_help():
|
||||||
|
print "Valid commands are:"
|
||||||
|
for command in commands:
|
||||||
|
print " " + command
|
||||||
|
print "Use '%s <command> -h' for more info about that command."%sys.argv[0]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
print "Specify a command. Valid commands are:"
|
print_help()
|
||||||
for command in commands:
|
|
||||||
print " " + command
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
command = sys.argv[1]
|
command = sys.argv[1]
|
||||||
if not command in commands:
|
if not command in commands:
|
||||||
print "Command '" + command + "' not recognised"
|
print "Command '" + command + "' not recognised."
|
||||||
|
print ""
|
||||||
|
print_help()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Trick optparse into displaying the right usage when --help is used.
|
# Trick optparse into displaying the right usage when --help is used.
|
||||||
|
@ -130,12 +130,14 @@ def main():
|
|||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = common.read_metadata(options.verbose)
|
apps = common.read_metadata(options.verbose)
|
||||||
|
|
||||||
for app in apps:
|
# Filter apps according to command-line options
|
||||||
|
if options.package:
|
||||||
|
apps = [app for app in apps if app['id'] == options.package]
|
||||||
|
if len(apps) == 0:
|
||||||
|
print "No such package"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if options.package and options.package != app['id']:
|
for app in apps:
|
||||||
# Silent skip...
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
print "Processing " + app['id'] + '...'
|
print "Processing " + app['id'] + '...'
|
||||||
|
|
||||||
mode = app['Update Check Mode']
|
mode = app['Update Check Mode']
|
||||||
|
@ -36,11 +36,20 @@ def main():
|
|||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
help="Spew out even more information than normal")
|
help="Spew out even more information than normal")
|
||||||
|
parser.add_option("-p", "--package", default=None,
|
||||||
|
help="Build only the specified package")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = common.read_metadata(options.verbose)
|
apps = common.read_metadata(options.verbose)
|
||||||
|
|
||||||
|
# Filter apps according to command-line options
|
||||||
|
if options.package:
|
||||||
|
apps = [app for app in apps if app['id'] == options.package]
|
||||||
|
if len(apps) == 0:
|
||||||
|
print "No such package"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
print "Writing " + app['id']
|
print "Writing " + app['id']
|
||||||
common.write_metadata(os.path.join('metadata', app['id']) + '.txt', app)
|
common.write_metadata(os.path.join('metadata', app['id']) + '.txt', app)
|
||||||
|
@ -50,6 +50,13 @@ def main():
|
|||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = common.read_metadata(options.verbose)
|
apps = common.read_metadata(options.verbose)
|
||||||
|
|
||||||
|
# Filter apps according to command-line options
|
||||||
|
if options.package:
|
||||||
|
apps = [app for app in apps if app['id'] == options.package]
|
||||||
|
if len(apps) == 0:
|
||||||
|
print "No such package"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
html_parser = HTMLParser.HTMLParser()
|
html_parser = HTMLParser.HTMLParser()
|
||||||
|
|
||||||
problems = []
|
problems = []
|
||||||
@ -59,9 +66,7 @@ def main():
|
|||||||
for app in apps:
|
for app in apps:
|
||||||
|
|
||||||
skip = False
|
skip = False
|
||||||
if options.package and app['id'] != options.package:
|
if app['Disabled']:
|
||||||
skip = True
|
|
||||||
elif app['Disabled']:
|
|
||||||
print "Skipping %s: disabled" % app['id']
|
print "Skipping %s: disabled" % app['id']
|
||||||
skip = True
|
skip = True
|
||||||
elif not app['builds']:
|
elif not app['builds']:
|
||||||
|
Loading…
Reference in New Issue
Block a user