Overriding package name in a package dependency?

Hi,

I work in an environment that requires that we mirror in all external dependencies. Therefore, I wrote a Swift script that mirrors SPM repositories recursively from external sites like GitHub to our internal Bitbucket server into a space there.

The problem I am facing is that a dependency like https://github.com/apple/swift-argument-parser cannot be stored in a folder 'apple' in bitbucket. So when rewriting all Package.swift files to point sub-dependencies to bitbucket too, I call the repository 'apple.swift-argument-parser' because the url ends in .../apple.swift-argument-parser.git.

This won't work because for SPM, the package is now no longer called 'swift-argument-parser' and I need a way to rename 'apple.swift-argument-parser' to remove the extra 'apple.'.

I saw that the name="..." attribute version of .package() is deprecated and wonder what alternative I have. Why is it deprecated at all?

Any help appreciated
/Andreas Pardeike