in reply to Finding path to a package
- Find all the unique directory paths from your list.(via sorting or a hash table)
- Find all the unique roots (I guesss there might be more than one). (a/b/c, a/b => a/b)
- Having vastly diminished the number of directories to check, for each unique root,
- open one file in that root,
- find it's package declaration,
- and parse it to determine what the directory entry should be.
- Examine the results for all the unique roots to see if you can merge the results.