Commit 48166bcb authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

autorun_post: modify normalizePaths regex



Current regex only worked for a narrow set of paths,
e.g. "/opt/spdk" and failed trying to normalize other
paths.
Make regex much more greedy by matching the whole path
up to first "/spdk/" occurence in path string.

Change-Id: Ia76b63dec6635cc9dc5d96f462cb89f2118844e2
Signed-off-by: default avatarKarol Latecki <karol.latecki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26229


Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
Reviewed-by: default avatarMichal Berger <michal.berger@nutanix.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
parent 3107a0e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ def normalizePaths(cov_file, repo_dir):
        file_contents = fh.read()
        replacement = "SF:" + os.path.abspath(repo_dir) + "/"
        if not re.search(rf'{replacement}', file_contents):
            replaced = re.sub(r'SF:/[^/]+/spdk/', replacement, file_contents)
            replaced = re.sub(r'SF:/.*?/spdk/', replacement, file_contents)

    if replaced:
        with open(cov_file, 'w') as fh: