Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/fpm/package/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,28 @@ def output(output_path)
raise FPM::InvalidPackageConfiguration, "#{name}: tar is insufficient to support source_date_epoch."
end

systemd_file_extensions = [
".service",
".socket",
".device",
".mount",
".automount",
".swap",
".target",
".path",
".timer",
".slice",
".scope",
]

attributes[:deb_systemd] = []
attributes.fetch(:deb_systemd_list, []).each do |systemd|
name = File.basename(systemd)
extname = File.extname(name)

name_with_extension = if extname.empty?
"#{name}.service"
elsif [".service", ".timer"].include?(extname)
elsif systemd_file_extensions.include?(extname)
name
else
raise FPM::InvalidPackageConfiguration, "Invalid systemd unit file extension: #{extname}. Expected .service or .timer, or no extension."
Comment thread
eira-fransham marked this conversation as resolved.
Outdated
Expand Down
Loading