set maxdepth appropriately for package scanning