Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions eng/_util/cmd/sign/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ func (a *archive) prepareArchiveSignatures(ctx context.Context) ([]*fileToSign,
if err := ctx.Err(); err != nil {
return nil, err
}
// Copy the archive file to have .sig suffix, e.g. "tar.gz" to "tar.gz.sig". The signing
// process sends the "tar.gz.sig" file to get a signature, then replaces the "tar.gz.sig"
// file's content in-place with the result. We need to preemptively make a renamed copy of the
// file so we end up with both the original file and sig on the machine.
// Copy the archive file with a ".sig" suffix. The signing process sends this file to get a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes it ambiguous (there is no archive file with a .sig suffix--yet).

Suggested change
// Copy the archive file with a ".sig" suffix. The signing process sends this file to get a
// Copy the archive file and add a ".sig" suffix. The signing process sends this new file to get a

// signature, then replaces its content in-place with the result. We need to preemptively make
// a renamed copy of the file so we end up with both the original file and signature on the
// machine.
log.Printf("Copying file for signature generation: %q -> %q", a.latestPath(), a.sigPath())
if err := copyFile(a.sigPath(), a.latestPath()); err != nil {
return nil, err
Expand Down Expand Up @@ -461,6 +461,10 @@ func (a *archive) copyToDestination(ctx context.Context) error {
if err := copyFile(filepath.Join(*destinationDir, a.name+".sig"), a.sigPath()); err != nil {
return err
}
// Also produce an .asc file (same content) to match upstream Go's convention.
if err := copyFile(filepath.Join(*destinationDir, a.name+".asc"), a.sigPath()); err != nil {
return err
}
return nil
}

Expand Down
Loading