summaryrefslogtreecommitdiff
path: root/instruby.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-13 15:49:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-13 15:49:56 +0000
commitd0166b55ea6afe59961e4e47b130f3d0cfc9ed6c (patch)
tree9992df6d3b9aa2de19b7b8e21a67847959f1070a /instruby.rb
parent2386041468827f0589c889ad9f7a04215161d5d9 (diff)
* common.mk (INSTRUBY_ARGS): pass mode to install. [ruby-dev:33766]
* instruby.rb (parse_args): added --data-mode and --prog-mode options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rwxr-xr-xinstruby.rb38
1 files changed, 23 insertions, 15 deletions
diff --git a/instruby.rb b/instruby.rb
index a5606e8452..901cd92afc 100755
--- a/instruby.rb
+++ b/instruby.rb
@@ -24,6 +24,8 @@ def parse_args()
$installed_list = nil
$dryrun = false
$rdocdir = nil
+ $data_mode = 0644
+ $prog_mode = 0755
opt = OptionParser.new
opt.on('-n') {$dryrun = true}
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
@@ -40,6 +42,12 @@ def parse_args()
[:local, :bin, :lib, :man, :ext, :"ext-arch", :"ext-comm", :rdoc]) do |ins|
$install << ins
end
+ opt.on('--data-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $data_mode = mode
+ end
+ opt.on('--prog-mode=OCTAL-MODE', OptionParser::OctalInteger) do |mode|
+ $prog_mode = mode
+ end
opt.on('--installed-list [FILENAME]') {|name| $installed_list = name}
opt.on('--rdoc-output [DIR]') {|dir| $rdocdir = dir}
@@ -119,7 +127,7 @@ def makedirs(dirs)
File.directory?(realdir)
end
end.compact!
- super(dirs, :mode => 0755) unless dirs.empty?
+ super(dirs, :mode => $prog_mode) unless dirs.empty?
end
def install_recursive(src, dest, options = {})
@@ -174,20 +182,20 @@ install?(:local, :arch, :bin) do
makedirs [bindir, libdir, archlibdir]
- install ruby_install_name+exeext, bindir, :mode => 0755
+ install ruby_install_name+exeext, bindir, :mode => $prog_mode
if rubyw_install_name and !rubyw_install_name.empty?
- install rubyw_install_name+exeext, bindir, :mode => 0755
+ install rubyw_install_name+exeext, bindir, :mode => $prog_mode
end
if enable_shared and dll != lib
- install dll, bindir, :mode => 0755
+ install dll, bindir, :mode => $prog_mode
end
- install lib, libdir, :mode => 0755 unless lib == arc
- install arc, libdir, :mode => 0644
- install "config.h", archlibdir, :mode => 0644
- install "rbconfig.rb", archlibdir, :mode => 0644
+ install lib, libdir, :mode => $prog_mode unless lib == arc
+ install arc, libdir, :mode => $data_mode
+ install "config.h", archlibdir, :mode => $data_mode
+ install "rbconfig.rb", archlibdir, :mode => $data_mode
if CONFIG["ARCHFILE"]
for file in CONFIG["ARCHFILE"].split
- install file, archlibdir, :mode => 0644
+ install file, archlibdir, :mode => $data_mode
end
end
@@ -243,7 +251,7 @@ install?(:local, :comm, :bin) do
name = ruby_install_name.sub(/ruby/, File.basename(src))
dest = File.join(bindir, name)
- install src, dest, :mode => 0755
+ install src, dest, :mode => $prog_mode
next if $dryrun
@@ -289,7 +297,7 @@ install?(:local, :comm, :lib) do
for f in Dir["lib/**/*{.rb,help-message}"]
dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir
makedirs dir
- install f, dir, :mode => 0644
+ install f, dir, :mode => $data_mode
end
end
@@ -299,13 +307,13 @@ install?(:local, :arch, :lib) do
Dir.chdir(srcdir)
makedirs [archlibdir]
for f in Dir["*.h"]
- install f, archlibdir, :mode => 0644
+ install f, archlibdir, :mode => $data_mode
end
if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
win32libdir = File.join(archlibdir, "win32")
makedirs win32libdir
- install "win32/win32.h", win32libdir, :mode => 0644
+ install "win32/win32.h", win32libdir, :mode => $data_mode
end
end
@@ -322,7 +330,7 @@ install?(:local, :comm, :man) do
makedirs destdir
if $mantype == "doc"
- install mdoc, destfile, :mode => 0644
+ install mdoc, destfile, :mode => $data_mode
else
require 'mdoc2man.rb'
@@ -334,7 +342,7 @@ install?(:local, :comm, :man) do
w.close
- install w.path, destfile, :mode => 0644
+ install w.path, destfile, :mode => $data_mode
end
end
end