1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-31 01:53:50 +02:00

feat: support replaces on nfpm (#1888)

* feat: support replaces on nfpm

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* Update www/docs/customization/nfpm.md
This commit is contained in:
Carlos Alexandro Becker 2020-11-06 15:17:08 -03:00 committed by GitHub
parent 17e56747cc
commit 9935b87100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View File

@ -165,6 +165,7 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries
Depends: overridden.Dependencies,
Recommends: overridden.Recommends,
Suggests: overridden.Suggests,
Replaces: overridden.Replaces,
EmptyFolders: overridden.EmptyFolders,
Files: files,
ConfigFiles: overridden.ConfigFiles,

View File

@ -101,6 +101,7 @@ func TestRunPipe(t *testing.T) {
Dependencies: []string{"make"},
Recommends: []string{"svn"},
Suggests: []string{"bzr"},
Replaces: []string{"fish"},
Conflicts: []string{"git"},
EmptyFolders: []string{"/var/log/foobar"},
Release: "10",
@ -607,6 +608,7 @@ func TestMeta(t *testing.T) {
Dependencies: []string{"make"},
Recommends: []string{"svn"},
Suggests: []string{"bzr"},
Replaces: []string{"fish"},
Conflicts: []string{"git"},
EmptyFolders: []string{"/var/log/foobar"},
Release: "10",

View File

@ -399,6 +399,7 @@ type NFPMOverridables struct {
Recommends []string `yaml:",omitempty"`
Suggests []string `yaml:",omitempty"`
Conflicts []string `yaml:",omitempty"`
Replaces []string `yaml:",omitempty"`
EmptyFolders []string `yaml:"empty_folders,omitempty"`
Files map[string]string `yaml:",omitempty"`
ConfigFiles map[string]string `yaml:"config_files,omitempty"`

View File

@ -85,6 +85,10 @@ nfpms:
- svn
- bash
# Packages it replaces.
replaces:
- fish
# Override default /usr/local/bin destination for binaries
bindir: /usr/bin
@ -133,7 +137,7 @@ nfpms:
preremove: "scripts/preremove.sh"
postremove: "scripts/postremove.sh"
# Some attributes can be overrided per package format.
# Some attributes can be overridden per package format.
overrides:
deb:
conflicts:
@ -144,6 +148,8 @@ nfpms:
- gitk
recommends:
- tig
replaces:
- bash
empty_folders:
- /var/log/bar
rpm: