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

Merge commit 'refs/merge-requests/86' of git://gitorious.org/f-droid/fdroidserver into merge-requests/86

This commit is contained in:
Ciaran Gultnieks 2012-03-12 20:30:04 +00:00
commit bc4240ca30
4 changed files with 34 additions and 12 deletions

14
fdroid
View File

@ -31,17 +31,23 @@ commands = [
"stats",
"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():
if len(sys.argv) <= 1:
print "Specify a command. Valid commands are:"
for command in commands:
print " " + command
print_help()
sys.exit(0)
command = sys.argv[1]
if not command in commands:
print "Command '" + command + "' not recognised"
print "Command '" + command + "' not recognised."
print ""
print_help()
sys.exit(1)
# Trick optparse into displaying the right usage when --help is used.

View File

@ -130,12 +130,14 @@ def main():
# Get all apps...
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']:
# Silent skip...
pass
else:
for app in apps:
print "Processing " + app['id'] + '...'
mode = app['Update Check Mode']

View File

@ -36,11 +36,20 @@ def main():
parser = OptionParser()
parser.add_option("-v", "--verbose", action="store_true", default=False,
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()
# Get all apps...
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:
print "Writing " + app['id']
common.write_metadata(os.path.join('metadata', app['id']) + '.txt', app)

View File

@ -50,6 +50,13 @@ def main():
# Get all apps...
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()
problems = []
@ -59,9 +66,7 @@ def main():
for app in apps:
skip = False
if options.package and app['id'] != options.package:
skip = True
elif app['Disabled']:
if app['Disabled']:
print "Skipping %s: disabled" % app['id']
skip = True
elif not app['builds']: