mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
Improved interactive mode in update script
This commit is contained in:
parent
d4caab9ea0
commit
4f417b7403
1 changed files with 19 additions and 8 deletions
27
update.py
27
update.py
|
@ -43,13 +43,15 @@ parser.add_option("-c", "--createmeta", action="store_true", default=False,
|
||||||
help="Create skeleton metadata files that are missing")
|
help="Create skeleton metadata files that are missing")
|
||||||
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("-q", "--quiet", action = "store_true", default=False,
|
parser.add_option("-q", "--quiet", action="store_true", default=False,
|
||||||
help="No output, except for warnings and errors")
|
help="No output, except for warnings and errors")
|
||||||
parser.add_option("-b", "--buildreport", action="store_true", default=False,
|
parser.add_option("-b", "--buildreport", action="store_true", default=False,
|
||||||
help="Report on build data status")
|
help="Report on build data status")
|
||||||
parser.add_option("-u", "--update", default=None,
|
parser.add_option("-i", "--interactive", default=False, action="store_true",
|
||||||
help="Run the specified command for each metadata file "+
|
help="Interactively ask about things that need updating.")
|
||||||
"that needs updating")
|
parser.add_option("-e", "--editor", default="/etc/alternatives/editor",
|
||||||
|
help="Specify editor to use in interactive mode. Default "+
|
||||||
|
"is /etc/alternatives/editor")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
@ -411,10 +413,19 @@ for app in apps:
|
||||||
for apk in apks:
|
for apk in apks:
|
||||||
if apk['id'] == app['id']:
|
if apk['id'] == app['id']:
|
||||||
print " " + str(apk['versioncode']) + " - " + apk['version']
|
print " " + str(apk['versioncode']) + " - " + apk['version']
|
||||||
if options.update != None:
|
if options.interactive:
|
||||||
subprocess.call([options.update, os.path.join('metadata',
|
print "Build data out of date for " + app['id']
|
||||||
app['id'] + '.txt')])
|
while True:
|
||||||
|
answer = raw_input("[I]gnore, [E]dit or [Q]uit?").lower()
|
||||||
|
if answer == 'i':
|
||||||
|
break
|
||||||
|
elif answer == 'e':
|
||||||
|
subprocess.call([options.editor,
|
||||||
|
os.path.join('metadata',
|
||||||
|
app['id'] + '.txt')])
|
||||||
|
break
|
||||||
|
elif answer == 'q':
|
||||||
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
apps_disabled += 1
|
apps_disabled += 1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue