What a huge arrow here.

I would suggest assuming the structure is always correct, as in ```{package-name}/{version}/arch/x86_64```, which will be true if the documented ways of manipulated packages are used. The profile won't compile if the structure is not correct anyways, so don't bother handling it.