correctly determining if a file is the main file of the package