Skip to content

Commit

Permalink
runtets task-fetch-url: infer relative paths of omitted
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Sep 22, 2023
1 parent afa4ea8 commit 2466afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bkr-runtest/gen_job_xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ if [info exist Opt(task-fetch-url)] {
append _url "@"
}
lassign [split ${_url} {[,@]}] taskname url
set taskname [regsub {^/+} $taskname {/}]
if ![regexp -- {.*#.*} ${url}] {
append url "#[regsub {^/*[^/]+/} $taskname {}]"
}
set taskFetchUrl($taskname) $url
}
}
Expand Down
1 change: 1 addition & 0 deletions share/common-options.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set CommonOptionList {
}}
task-fetch-url {arg m help {accept a fetch url for a special task. e.g:
--task-fetch-url /distribution/kernelinstall@https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.tar.gz#distribution/kernelinstall
--task-fetch-url /kernel/fs/nfs/base@http://fs-qe.usersys.redhat.com/ftp/pub/jiyin/kernel-test.tgz #the '#relative path' could be omitted
--task-fetch-url /distribution/kernelinstall@ #means disable fetch-url for this task
}}
norun {arg n help {only download task without running it}}
Expand Down
3 changes: 3 additions & 0 deletions utils/taskname2url.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
if not re.search(r'[@,]', arg):
arg = f"{arg}@"
tname, uri = re.split("[,@]", arg[6:])
tname = re.sub('^/+/', '/', tname)
if not re.search(r'#', uri):
uri += f"#{re.sub('^/*[^/]+/', '', tname)}"
taskdict[tname] = uri
elif (arg[:5] == "-skip"):
skiprepo = "yes"
Expand Down

0 comments on commit 2466afc

Please sign in to comment.