add function to detect the package name for a source file