Skip to content

Conversation

@mattt
Copy link
Contributor

@mattt mattt commented Sep 16, 2021

Updates swift package archive-source command according to the SE-0292 amendment.

Motivation:

With #3624, the behavior of the archive-source command now adds a --prefix argument to the git-archive invocation, so that entries are prefixed by output name.

Modifications:

  try callGit("archive",
              "--format", "zip",
+             "--prefix", path.basenameWithoutExt,
              "--output", path.pathString,
              "HEAD",
              failureMessage: "Couldn’t create an archive")

Result:

Generated source archives are prefixed by output name.

For example:

$ swift package archive-source --output="LinkedList-1.2.0.zip"
$ zipinfo LinkedList-1.2.0.zip
Archive:  path/to/LinkedList-1.2.0.zip
[...]
[...] LinkedList-1.2.0/
[...] LinkedList-1.2.0/Package.swift

@mattt
Copy link
Contributor Author

mattt commented Sep 16, 2021

@swift-ci Please smoke test

@tomerd tomerd merged commit 7197f40 into swiftlang:main Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants