1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

make-snapshot: make permissions uniform

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-01-17 23:52:58 +00:00
parent dabbdcfd6d
commit 6b5695fef9

View file

@ -167,20 +167,23 @@ def tar_create(tarball, dir)
Dir.glob("#{dir}/**/*", File::FNM_DOTMATCH) do |path|
next if File.basename(path) == "."
s = File.stat(path)
mode = 0644
case
when s.file?
type = nil
size = s.size
mode |= 0111 if s.executable?
when s.directory?
path += "/"
type = dir_type
size = 0
mode |= 0111
else
next
end
name, prefix = w.split_name(path)
h = header.new(name: name, prefix: prefix, typeflag: type,
mode: s.mode, size: size, mtime: s.mtime,
mode: mode, size: size, mtime: s.mtime,
uname: uname, gname: gname)
f.write(h)
if size > 0