copied over and modified setuptools archive_util implementation