bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

How to configure the format used in FPM::Package::Deb.to_s? #210

Open Rylon opened 5 years ago

Rylon commented 5 years ago

Hi,

I raised this on the FPM project too, but wondered if you had any insights related to doing this via a recipe:

https://github.com/jordansissel/fpm/issues/1659

We want to make sure the Epoch gets included in the filename, we can see that FPM::Package::Deb.to_s is responsible for interpolating the filename, but it defaults to this: "NAME_FULLVERSION_ARCH.EXTENSION"

We'd like to change it to match the Debian packaging spec: "NAME_EPOCH:FULLVERSION_ARCH.EXTENSION".

Is it possible to set this properly via some mechanism?

For the time being we've monkey patched inside our recipe.rb:

# Monkey patches to override default format to contain the Epoch according to Debian Packaging Specs.
class FPM::Package::Deb < FPM::Package
  def to_s(format=nil)
    return super("NAME_EPOCH:FULLVERSION_ARCH.EXTENSION")
  end
end
bernd commented 2 years ago

@Rylon Quite late, but better than never. :smile:

I created PR #215 to add a package_name_format field to the recipe object to allow the modification of the file format.

Rylon commented 2 years ago

Nice, thanks @bernd !