jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.17k stars 1.07k forks source link

Attempting to set deb epoch to nil results in invalid package #2033

Open femiagbabiaka opened 1 year ago

femiagbabiaka commented 1 year ago
snip@snip:~$ curl -L https://artifacts.elastic.co/downloads/logstash/logstash-8.10.4-amd64.deb -o logstash-8.10.4-amd64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  333M  100  333M    0     0  24.2M      0  0:00:13  0:00:13 --:--:-- 44.0M
snip@snip:~$ dpkg-deb --info logstash-8.10.4-amd64.deb
 new Debian package, version 2.0.
 size 349219502 bytes: control archive=331827 bytes.
     237 bytes,     8 lines      conffiles
     375 bytes,    13 lines      control
 1545654 bytes, 11755 lines      md5sums
    1026 bytes,    28 lines   *  postinst             #!/bin/sh
     619 bytes,    20 lines   *  preinst              #!/bin/sh
     974 bytes,    38 lines   *  prerm                #!/bin/sh
 Package: logstash
 Version: 1:8.10.4-1
 License: Elastic-License
 Vendor: Elastic
 Architecture: amd64
 Maintainer: <buildkite-agent@bk-agent-prod-gcp-1696958443873164767>
 Installed-Size: 593254
 Conflicts: logstash (<< 7.10.0)
 Replaces: logstash (<< 7.10.0)
 Section: default
 Priority: optional
 Homepage: https://www.elastic.co/logstash
 Description: An extensible logging pipeline
 snip@snip:~$ fpm -f -s deb -t deb -p logstash-8.10.4-amd64.deb -v 8.10.4 --epoch "" logstash-8.10.4-amd64.deb
Force flag given. Overwriting package at logstash-8.10.4-amd64.deb {:level=>:warn}
epoch in Version is set {:epoch=>"", :level=>:warn}
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
snip@snip:~$ dpkg-deb --info logstash-8.10.4-amd64.deb
 new Debian package, version 2.0.
 size 349152794 bytes: control archive=331676 bytes.
     237 bytes,     8 lines      conffiles
     311 bytes,    11 lines      control
 1545731 bytes, 11756 lines      md5sums
    1026 bytes,    28 lines   *  postinst             #!/bin/sh
     619 bytes,    20 lines   *  preinst              #!/bin/sh
     974 bytes,    38 lines   *  prerm                #!/bin/sh
 Package: logstash
 Version: :8.10.4-1
 License: Elastic-License
 Vendor: Elastic
 Architecture: amd64
 Maintainer: <buildkite-agent@bk-agent-prod-gcp-1696958443873164767>
 Installed-Size: 593254
 Section: default
 Priority: optional
 Homepage: https://www.elastic.co/logstash
 Description: An extensible logging pipeline

Other permutations of the same thing have a similar effect (setting epoch and not setting version, for example).

jordansissel commented 1 year ago

Oh, neat! Thank you for reporting this. I agree that this is a bug.

On Thu, Nov 2, 2023, at 4:53 PM, Femi Agbabiaka wrote:

@.:~$ curl -L https://artifacts.elastic.co/downloads/logstash/logstash-8.10.4-amd64.deb -o logstash-8.10.4-amd64.deb % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 333M 100 333M 0 0 24.2M 0 0:00:13 0:00:13 --:--:-- 44.0M @.:~$ dpkg-deb --info logstash-8.10.4-amd64.deb new Debian package, version 2.0. size 349219502 bytes: control archive=331827 bytes. 237 bytes, 8 lines conffiles 375 bytes, 13 lines control 1545654 bytes, 11755 lines md5sums 1026 bytes, 28 lines postinst #!/bin/sh 619 bytes, 20 lines preinst #!/bin/sh 974 bytes, 38 lines * prerm #!/bin/sh Package: logstash Version: 1:8.10.4-1 License: Elastic-License Vendor: Elastic Architecture: amd64 Maintainer: @.> Installed-Size: 593254 Conflicts: logstash (<< 7.10.0) Replaces: logstash (<< 7.10.0) Section: default Priority: optional Homepage: https://www.elastic.co/logstash Description: An extensible logging pipeline @.:~$ fpm -f -s deb -t deb -p logstash-8.10.4-amd64.deb -v 8.10.4 --epoch "" logstash-8.10.4-amd64.deb Force flag given. Overwriting package at logstash-8.10.4-amd64.deb {:level=>:warn} epoch in Version is set {:epoch=>"", :level=>:warn} Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn} @.:~$ dpkg-deb --info logstash-8.10.4-amd64.deb new Debian package, version 2.0. size 349152794 bytes: control archive=331676 bytes. 237 bytes, 8 lines conffiles 311 bytes, 11 lines control 1545731 bytes, 11756 lines md5sums 1026 bytes, 28 lines postinst #!/bin/sh 619 bytes, 20 lines preinst #!/bin/sh 974 bytes, 38 lines prerm #!/bin/sh Package: logstash Version: :8.10.4-1 License: Elastic-License Vendor: Elastic Architecture: amd64 Maintainer: **@.***> Installed-Size: 593254 Section: default Priority: optional Homepage: https://www.elastic.co/logstash Description: An extensible logging pipeline ` Other permutations of the same thing have a similar effect (setting epoch and not setting version, for example).

— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/issues/2033, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2TQVFJD7KLJT5KDBVTYCQW7FAVCNFSM6AAAAAA63VF442VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TKMRRGU3DANQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>