Skip to content

Commit

Permalink
resolve #1840
Browse files Browse the repository at this point in the history
  • Loading branch information
tiandrey authored and jordansissel committed Nov 3, 2021
1 parent 60de482 commit 74a25ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 2 additions & 5 deletions lib/fpm/package/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def output(output_path)
compression = "-z"
when "bzip2"
datatar = build_path("data.tar.bz2")
controltar = build_path("control.tar.bz2")
controltar = build_path("control.tar.gz")
compression = "-j"
when "xz"
datatar = build_path("data.tar.xz")
Expand Down Expand Up @@ -863,12 +863,9 @@ def write_control_tarball

# Tar up the staging_path into control.tar.{compression type}
case self.attributes[:deb_compression]
when "gz", nil
when "gz", "bzip2", nil
controltar = "control.tar.gz"
compression = "-z"
when "bzip2"
controltar = "control.tar.bz2"
compression = "-j"
when "xz"
controltar = "control.tar.xz"
compression = "-J"
Expand Down
11 changes: 9 additions & 2 deletions spec/fpm/package/deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,16 @@ def dpkg_field(field)
deb.output(target)
end

it "should use #{suffix} for data and control files" do
control_suffix = case flag
when 'bzip2'
'gz'
else
suffix
end

it "should use #{suffix} for data file and #{control_suffix} for control file" do
list = `ar t #{target}`.split("\n")
insist { list }.include?("control.tar.#{suffix}")
insist { list }.include?("control.tar.#{control_suffix}")
insist { list }.include?("data.tar.#{suffix}")
end
end
Expand Down

0 comments on commit 74a25ad

Please sign in to comment.