Skip to content

Commit

Permalink
Merge pull request #450 from AudaxHealthInc/fpm_fix_macos
Browse files Browse the repository at this point in the history
Make debian control tarball use owner and group arguments (gnutar fix)
  • Loading branch information
jordansissel committed May 30, 2013
2 parents b37a62c + fe4034b commit 8e17c21
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/fpm/package/deb.rb
Expand Up @@ -327,9 +327,15 @@ def output(output_path)
tar_flags += [ "--owner", attributes[:deb_user] ]
end
if !attributes[:deb_group].nil?
tar_flags += [ "--group", attributes[:deb_group] ]
if attributes[:deb_group] == 'root'
tar_flags += [ "--numeric-owner", "--group", "0" ]
else
tar_flags += [ "--group", attributes[:deb_group] ]
end
end

write_control_tarball(tar_flags)

if attributes[:deb_changelog]
dest_changelog = File.join(staging_path, "usr/share/doc/#{attributes[:name]}/changelog.Debian")
FileUtils.mkdir_p(File.dirname(dest_changelog))
Expand Down Expand Up @@ -431,7 +437,7 @@ def control_path(path=nil)
end
end # def control_path

def write_control_tarball
def write_control_tarball(tar_flags=[])
# Use custom Debian control file when given ...
write_control # write the control file
write_shlibs # write optional shlibs file
Expand All @@ -443,8 +449,9 @@ def write_control_tarball
# Make the control.tar.gz
with(build_path("control.tar.gz")) do |controltar|
@logger.info("Creating", :path => controltar, :from => control_path)
safesystem(tar_cmd, "--owner=root", "--group=root", "-zcf",
controltar, "-C", control_path, ".")

args = [ tar_cmd, "-C", control_path, "-z" ] + tar_flags + [ "-cf", controltar, "." ]
safesystem(*args)
end

@logger.debug("Removing no longer needed control dir", :path => control_path)
Expand Down

0 comments on commit 8e17c21

Please sign in to comment.