Improved dist detection and path generation

Change-Id: I6b0caef19dc17482389b0752634f717045f057b7
Signed-off-by: David Caro <dcaroest@redhat.com>