The patterns were validated from $PWD and later applied on path relative
to root_path. So we shuffle a bit the code to test them against
root_path. We make the absolute pattern relative in the same go.
This code is coming from swh-scanner and should probably get an
overhaul, however for now we start by making it not broken.