goreleaser / nfpm

nFPM is Not FPM - a simple deb, rpm, apk, ipk, and arch linux packager written in Go
https://nfpm.goreleaser.com/
MIT License
2.14k stars 156 forks source link

Mismatch in rpm package produced by nfpm and it's corresponding ConventionalFileName #700

Closed asutosh closed 1 year ago

asutosh commented 1 year ago

What happened?

Not sure if this should filed in nFPM instead of here, please let me know if it should be filed in nFPM issue tracker.

We use goreleaser to package our binary to deb and rpm packages, and finally these gets pushed to a packagecloud repository.

We don't have an explicit release value specified in the goreleaser config. So the produced rpm package has the default release value set(1)

But the ConventionalFileName doesn't have this default release value included( gets named as name-version.architecture.rpm) instead of name-version-release.architecture.rpm )

For us, when this package gets uploaded to packagecloud repository, the package gets named based on the rpm file naming convention according to the rpm metadata, and the package gets named with the release value appended to the version(name-version-1.architecture.rpm)

So for any re-run of the same gorelaser run, if we have to remove an already uploaded package based on the ConventionalFileName, it's not possible as the package name based on the package metadata and the actual ConventionalFileName given by nFPM are different.

How can we reproduce this?

Create any rpm package without providing an explicit Release value, and look at the produced ConventionalFileName and the produced rpm file metadata. The ConventionalFileName wouldn't have the default release value(`1')

goreleaser version

____       ____      _
 / ___| ___ |  _ \ ___| | ___  __ _ ___  ___ _ __
| |  _ / _ \| |_) / _ \ |/ _ \/ _` / __|/ _ \ '__|
| |_| | (_) |  _ <  __/ |  __/ (_| \__ \  __/ |
 \____|\___/|_| \_\___|_|\___|\__,_|___/\___|_|
goreleaser: Deliver Go Binaries as fast and easily as possible
https://goreleaser.com

GitVersion:    v1.20.0
GitCommit:     unknown
GitTreeState:  unknown
BuildDate:     unknown
BuiltBy:       unknown
GoVersion:     go1.20.3
Compiler:      gc
ModuleSum:     h1:wvAbDqQwMX3PWPYc4VIeaWQB2V5HOETvDlyfTrk7NgQ=
Platform:      linux/amd64

GoReleaser Check

Search

Supporter

Code of Conduct

Additional context

No response

caarlos0 commented 1 year ago

hey, looks like an issue in nfpm indeed, will transfer the issue.

thanks for reporting!