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.09k stars 154 forks source link

only last depends/provides/conflicts are written in package #785

Closed kduret closed 5 months ago

kduret commented 5 months ago

What happened?

when using overrides.deb.depends , overrides.deb.provides and overrides.deb.conflicts , only the last element of the list is written in the package

How can we reproduce this?

create a package centreon-web with following section :

overrides:
  deb:
    depends:
      - centreon-common (= ${VERSION}-${RELEASE}${DIST})
      - centreon-perl-libs (= ${VERSION}-${RELEASE}${DIST})
      - centreon-poller (= ${VERSION}-${RELEASE}${DIST})
      - "centreon-broker-cbd (>= ${MAJOR_VERSION}~)"
      - "centreon-broker-cbd (<< ${NEXT_MAJOR_VERSION}~)"
      - lsb-release
      - apache2
      - php8.1
      - php8.1-cli
      - php8.1-fpm
      - php8.1-curl
      - php8.1-intl
      - php8.1-xml
      - php8.1-dom
      - php8.1-gd
      - php8.1-mbstring
      - php8.1-xml
      - php8.1-mysql
      - php8.1-zip
      - php8.1-snmp
      - php8.1-ldap
      - php8.1-readline
      - php8.1-sqlite3
      - php-pear
      - rrdtool
      - locales
      - gettext
      - rsync
      - brotli
      - lua-curl
    provides:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview
    conflicts:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview
    replaces:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview

run apt show centreon-web :

# apt show centreon-web
Package: centreon-web
Version: 24.04.0-bullseye
Priority: optional
Section: net
Source: centreon
Maintainer: Centreon <contact@centreon.com>
Installed-Size: 79.9 MB
Provides: centreon-widget-tactical-overview
Depends: centreon-broker-cbd (<< 24.05~), centreon-broker-cbd (>= 24.04~), centreon-gorgone-centreon-config (<< 24.05~), centreon-gorgone-centreon-config (>= 24.04~), centreon-web-common (<< 24.05~), centreon-web-common (>= 24.04~), lsb-release, php-pear, php8.1-curl, php8.1-dom, php8.1-gd, php8.1-intl, php8.1-ldap, php8.1-mbstring, php8.1-mysql, php8.1-readline, php8.1-snmp, php8.1-sqlite3, php8.1-xml, php8.1-zip, rrdtool
Recommends: ntp | bsd-mailx
Suggests: nagios-images
Conflicts: centreon-widget-tactical-overview
Replaces: centreon-widget-tactical-overview
Homepage: https://www.centreon.com
Download-Size: 9535 kB
APT-Sources: https://packages.centreon.com/apt-standard-24.04-stable bullseye/main amd64 Packages
Description: This package contains WebUI files.

Only centreon-widget-tactical-overview is added

nfpm version

_____ ____  __  __
 _ __ |  ___|  _ \|  \/  |
| '_ \| |_  | |_) | |\/| |
| | | |  _| |  __/| |  | |
|_| |_|_|   |_|   |_|  |_|
nfpm: a simple and 0-dependencies deb, rpm, apk and arch linux packager written in Go
https://nfpm.goreleaser.com

GitVersion:    2.35.3
GitCommit:     5ace4da2fd3162383a16218e2ef405dc2676bdfc
GitTreeState:  false
BuildDate:     2024-01-31T17:53:18Z
BuiltBy:       goreleaser
GoVersion:     go1.21.6
Compiler:      gc
ModuleSum:     h1:YGEygriY8hbsNdCBUif6RLb5xPISDHc+d22rRGXV4Zk=
Platform:      linux/amd64

Search

Code of Conduct

Additional context

overrides.deb.depends is ok

this breaks our deb packages upgrades :

The following packages have unmet dependencies: centreon-widget-engine-status : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-global-health : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-graph-monitoring : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-grid-map : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-host-monitoring : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-hostgroup-monitoring : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-httploader : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-live-top10-cpu-usage : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-live-top10-memory-usage : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-service-monitoring : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-servicegroup-monitoring : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed centreon-widget-single-metric : Depends: centreon-web (< 23.11~) but 24.04.0-bullseye is to be installed

caarlos0 commented 5 months ago

I tested it with the following yaml:

# nfpm example configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: "foo"
arch: "amd64"
platform: "linux"
version: "1.0.0"
section: "default"
priority: "extra"
replaces:
- foobar
provides:
- bar
depends:
- foo
- bar
recommends:
- whatever
suggests:
- something-else
conflicts:
- not-foo
- not-bar
maintainer: "John Doe <john@example.com>"
description: |
  FooBar is the great foo and bar software.
    And this can be in multiple lines!
vendor: "FooBarCorp"
homepage: "http://example.com"
license: "MIT"
contents:
- src: ./foo
  dst: /usr/bin/foo
overrides:
  deb:
    depends:
      - centreon-common (= ${VERSION}-${RELEASE}${DIST})
      - centreon-perl-libs (= ${VERSION}-${RELEASE}${DIST})
      - centreon-poller (= ${VERSION}-${RELEASE}${DIST})
      - "centreon-broker-cbd (>= ${MAJOR_VERSION}~)"
      - "centreon-broker-cbd (<< ${NEXT_MAJOR_VERSION}~)"
      - lsb-release
      - apache2
      - php8.1
      - php8.1-cli
      - php8.1-fpm
      - php8.1-curl
      - php8.1-intl
      - php8.1-xml
      - php8.1-dom
      - php8.1-gd
      - php8.1-mbstring
      - php8.1-xml
      - php8.1-mysql
      - php8.1-zip
      - php8.1-snmp
      - php8.1-ldap
      - php8.1-readline
      - php8.1-sqlite3
      - php-pear
      - rrdtool
      - locales
      - gettext
      - rsync
      - brotli
      - lua-curl
    provides:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview
    conflicts:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview
    replaces:
      - centreon-web-apache
      - centreon-web-common
      - centreon-widget-engine-status
      - centreon-widget-global-health
      - centreon-widget-graph-monitoring
      - centreon-widget-grid-map
      - centreon-widget-httploader
      - centreon-widget-host-monitoring
      - centreon-widget-hostgroup-monitoring
      - centreon-widget-live-top10-cpu-usage
      - centreon-widget-live-top10-memory-usage
      - centreon-widget-ntopng-listing
      - centreon-widget-service-monitoring
      - centreon-widget-servicegroup-monitoring
      - centreon-widget-single-metric
      - centreon-widget-tactical-overview

(basically nfpm init plus the replaces your provided)

and with dpkg -I, and got this:

CleanShot 2024-02-08 at 16 12 54@2x

can you share your entire nfpm.yml? or a minimal reproducible?

kduret commented 5 months ago

Indeed I'm not able to reproduce anymore 😨 Sorry for the noise I will reopen the ticket if reproduce the case