@@ -166,7 +166,7 @@ def parse_options(cfg, parser, cmdargs):
parser.add_argument("-V", "--version", dest="rteval___version",
action='store_true', default=False,
help='print rteval version and exit')
- parser.add_argument("-S", "--source-download", dest="rteval___srcdownload",
+ parser.add_argument("-S", "--source-download", nargs="*", dest="rteval___srcdownload",
type=str, default=None, metavar="KERNEL_VERSION",
help='download a source kernel from kernel.org and exit')
@@ -191,8 +191,16 @@ def parse_options(cfg, parser, cmdargs):
ind = cmdargs.index('--raw-histogram')
cmd_args = cmdargs[ind+1:]
cmdargs = cmdargs[:ind+1]
+
cmd_opts = parser.parse_args(args=cmdargs)
+ # if no kernel version was provided for --source-download, set version to default
+ if (sys.argv.count('-S')+sys.argv.count('--source-download')) > 0:
+ if cmd_opts.rteval___srcdownload == []:
+ cmd_opts.rteval___srcdownload = ModuleParameters()["source"]["default"].replace(".tar.xz", "")
+ else:
+ cmd_opts.rteval___srcdownload = cmd_opts.rteval___srcdownload[0]
+
if cmd_opts.rteval___version:
print(f"rteval version {RTEVAL_VERSION}")
sys.exit(0)
Previously, the usuage was "./rteval-cmd -S [KERNEL_VERSION]", and rteval-cmd would throw an error if no kernel version was provided. Now, rteval-cmd will download the default kernel version, as specified in rteval/modules/loads/kcompile.py. Signed-off-by: Anubhav Shelat <ashelat@redhat.com> --- rteval-cmd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)