refactor detection loop and identify duplicates
refactor detection loop and identify duplicates

the nesting was deeper than necessary, so adjusting the detection of files
(and directories) and adding a bit more logging upon duplicate detection

tLDP/python-tldp,tLDP/python-tldp,tLDP/python-tldp