diff options
author | Josh Boyer <jwboyer@redhat.com> | 2012-05-10 10:39:56 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@redhat.com> | 2012-05-10 10:39:56 -0400 |
commit | 6108acddac7f3acb9bc395c1398a644a6eff6cf4 (patch) | |
tree | 87a19f0bb176ddaf98ab71de239598af4cbfb549 /koji-bisect.py | |
parent | a4708a0f8a3ec0274b18a5c3d06b13bec0c5db7c (diff) | |
download | koji-bisect-6108acddac7f3acb9bc395c1398a644a6eff6cf4.tar.gz koji-bisect-6108acddac7f3acb9bc395c1398a644a6eff6cf4.tar.xz koji-bisect-6108acddac7f3acb9bc395c1398a644a6eff6cf4.zip |
Add an arch argument
Default to whatever machine type the script is being run on, but let people
override it with --arch (for whatever reason they might want to do that).
I'm sure someone will weep because I used uname, but oh well.
Also, drop the fancy © symbol because python freaks right the hell out about
having it in a comment. Go python.
Diffstat (limited to 'koji-bisect.py')
-rwxr-xr-x | koji-bisect.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/koji-bisect.py b/koji-bisect.py index 599c56c..b0257cd 100755 --- a/koji-bisect.py +++ b/koji-bisect.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright © 2012 Red Hat Inc. +# Copyright 2012 Red Hat Inc. # Author(s): Josh Boyer <jwboyer@redhat.com> # # This program is free software; you can redistribute it and/or modify it @@ -205,6 +205,7 @@ def get_args(): parser.add_argument('--bad', action='store', help='bad kernel NVR') parser.add_argument('--list', action='store_true', help='list of builds remaining') parser.add_argument('--dist', action='store', help='disttag of specific release') + parser.add_argument('--arch', action='store', help='architecture to work with') parser.add_argument('--start', action='store_true', help='start bisecting') parser.add_argument('--reset', action='store_true', help='cancel bisecting') @@ -255,6 +256,7 @@ def bisect_load(): bisect_data_def = { 'good': None, 'bad': None, 'current' : None, + 'arch' : None, 'builds_left': None } bisect_data = bisect_data_def @@ -337,6 +339,12 @@ if __name__ == "__main__": bisect_data_file.close() bisect_data_file = None + if not bisect_data['arch']: + if args.arch: + bisect_data['arch'] = args.arch + else: + bisect_data['arch'] = os.uname()[4] + if not args.good and not args.bad: if args.list: list_builds(bisect_data) @@ -394,13 +402,11 @@ if __name__ == "__main__": bisect_data['current'] = current os.makedirs('downloads/%s' % bisect_data['current']) - download_build(session, bisect_data['current'], 'x86_64') + download_build(session, bisect_data['current'], bisect_data['arch']) print "-------------------------------------------------------" print "%s is now available for install." % bisect_data['current'] - bisect_save(bisect_data) - if args.list: list_builds(bisect_data) |