[ARVADOS] updated: 9454df6ea65e3afa9586cabea34abc42c328bd65
git at public.curoverse.com
git at public.curoverse.com
Thu Apr 3 13:59:09 EDT 2014
Summary of changes:
docker/build_tools/config.rb | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)
via 9454df6ea65e3afa9586cabea34abc42c328bd65 (commit)
from cab9d1a8bd750638efbff292093624bf5bdb8767 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9454df6ea65e3afa9586cabea34abc42c328bd65
Author: Tim Pierce <twp at curoverse.com>
Date: Thu Apr 3 14:00:16 2014 -0400
Set umask to 022 when creating config files. (refs #2221)
diff --git a/docker/build_tools/config.rb b/docker/build_tools/config.rb
index a31895b..7acb888 100755
--- a/docker/build_tools/config.rb
+++ b/docker/build_tools/config.rb
@@ -34,35 +34,34 @@ Dir.glob('*/generated/*') do |stale_file|
File.delete(stale_file)
end
+File.umask(022)
Dir.glob('*/*.in') do |template_file|
generated_dir = File.join(File.dirname(template_file), 'generated')
Dir.mkdir(generated_dir) unless Dir.exists? generated_dir
output_path = File.join(generated_dir, File.basename(template_file, '.in'))
- output = File.open(output_path, "w")
- File.open(template_file) do |input|
- input.each_line do |line|
+ File.open(output_path, "w") do |output|
+ File.open(template_file) do |input|
+ input.each_line do |line|
- @count = 0
- while @count < 10
- @out = line.gsub!(/@@(.*?)@@/) do |var|
- if config.key?(Regexp.last_match[1])
- config[Regexp.last_match[1]]
- else
- var.gsub!(/@@/, '@_NOT_FOUND_@')
+ # This count is used to short-circuit potential
+ # infinite loops of variable substitution.
+ @count = 0
+ while @count < 10
+ @out = line.gsub!(/@@(.*?)@@/) do |var|
+ if config.key?(Regexp.last_match[1])
+ config[Regexp.last_match[1]]
+ else
+ var.gsub!(/@@/, '@_NOT_FOUND_@')
+ end
end
+ break if @out.nil?
+ @count += 1
end
- break if @out.nil?
- @count += 1
- end
- output.write(line)
+ output.write(line)
+ end
end
end
- # Copy the owner's read+execute bits to group and other.
- owner_perms = output.stat.mode & 0700
- group_perms = (owner_perms & 0500) >> 3
- output.chmod(owner_perms | group_perms | (group_perms >> 3))
- output.close
end
# Copy the ssh public key file to base/generated (if a path is given)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list