b0VIM 6.1=kLOphiltraveller.home.com~phil/ruby_stuff/installpkg-0.0.1/lib/install-pkg.rb3210#"! Utp t , 5ladz }yXV3|lLD93/+* | h g ? 3   { z ` F , ^ [ ' | N  ] 3   oD>=, t.oRmPx[!v2r,(' ] ] 'does not compile/install ruby extentions' ] ] 'yes/no', [ 'without-ext', [ 'no', 'the make program to compile ruby extentions' ] ], 'name', [ 'make-prog', [ 'make', 'the ruby program using for installation' ] ], 'name', [ 'ruby-prog', [ rubypath, 'path to set to #! line' ] ], 'path', [ 'ruby-path', [ rubypath, 'the directory for shared data' ] ], 'path', [ 'data-dir', [ '$prefix/share', 'the directory for ruby extentions' ] ], 'path', [ 'so-dir', [ sodir, 'the directory for ruby scripts' ] ], 'path', [ 'rb-dir', [ '$site-ruby', 'the directory for commands' ] ], 'path', [ 'bin-dir', [ '$prefix/bin', 'the directory for non-standard ruby libraries' ] ], 'path', [ 'site-ruby', [ versite, 'the directory for version-independent non-standard ruby libraries' ] ], 'path', [ 'site-ruby-common', [ siteruby, 'the directory for standard ruby libraries' ] ], 'path', [ 'std-ruby', [ stdruby, 'path prefix of target environment' ] ], 'path', [ 'prefix', [ c['prefix'], DESCRIPTER = [ end sodir = "$site-ruby/#{c['arch']}" versite = siteruby siteruby = "$prefix/lib/ruby/#{version}/site_ruby" stdruby = "$prefix/lib/ruby/#{version}" # V < 1.4.4 else sodir = "$site-ruby/#{c['arch']}" versite = siteruby + '/' + version siteruby = subprefix.call(c['sitedir']) stdruby = "$prefix/lib/ruby/#{version}" # 1.4.4 <= V <= 1.6.3 elsif newpath_p then sodir = subprefix.call(c['sitearchdir']) versite = subprefix.call(c['sitelibdir']) siteruby = subprefix.call(c['sitedir']) stdruby = subprefix.call(c['rubylibdir']) # 1.6.3 < V if c['rubylibdir'] then } re === path and path.sub(re, '$prefix') subprefix = lambda {|path| re = Regexp.new('\A' + Regexp.quote(c['prefix'])) ((minor == 4) and (teeny >= 4))))) ((minor >= 5) or ((major == 1) and newpath_p = ((major >= 2) or # ruby ver. >= 1.4.4? version = "#{major}.#{minor}" teeny = c['TEENY'].to_i minor = c['MINOR'].to_i major = c['MAJOR'].to_i rubypath = c['bindir'] + '/' + c['ruby_install_name'] c = ::Config::CONFIGclass ConfigTablemodule InstallPkgend require 'rbconfig'else require file ARGV.delete_at(i) file = $'if i = ARGV.index(/\A--rbconfig=/) then### begin config.rb### end compat.rbend File.open(fname, 'wb') {|f| f.write str }def File.write( fname, str )end File.open(fname, 'rb') {|f| return f.read }def File.read_all( fname )endend end result end result = yield(result, i) each do |i| def inject( result )module Enumerableunless Enumerable.instanc## the GNU Lesser General Public License version 2.# You can distribute/modify this program under the terms of# This program is free software.## Modifications by Phil Tomson# # Copyright (c) 2000-2002 Minero Aoki # Taken mostly from Minero Aoki's install.rb:## install-pkg.rb#ad>lKJ='X2 { 3 2 %  z v u c Y H B A = 4 0 /  y q k j f e  w n F  z 2  VIA;:~IA;:#" m,end #InstallPkg.install_pkg('thispkg') InstallPkg.install_pkg_with_dependencies('thispkg',depends_on) depends_on = {'webfetcher'=>'0.0.0', 'scan_for_ruby'=>'0.0.0'} include InstallPkg #your install.rb would look something like this:if $0 == __FILE__ then### end toplevel.rbend #module InstallPkg end end puts "Can't install package: #{package}: #{e}" rescue RAAInstall::InstallException => e RAAInstall.suck(RAAInstall::XMLParser.new.get_package_descriptions(RAAInstall.get_data),package) begin def get_dependency(package) end end exit 1 $stderr.puts "try 'ruby #{$0} --help' for usage" $stderr.puts $!.message raise if $DEBUG rescue installer.execute('install') installer.execute('setup') installer.execute('config') installer = InstallPkg::ToplevelInstaller.new( File.dirname($0) ) begin def install end install def InstallPkg.install_pkg(name=nil) end end install ensure } get_dependency(pkg) puts "installing dependency: #{pkg}" depends_on_hash.keys.each { |pkg| else puts "installing package: #{name} only" puts "raainstall package not available: #{error}" rescue LoadError => error require 'raainstall' begin def InstallPkg.install_pkg_with_dependencies(name,depends_on_hash)end end end printf "%-10s %s\n", k, v end v = '(not specified)' if not v or v.empty? then v = @config.get_raw(k) ConfigTable.each_name do |k| def exec_show # # show # end @config.save super def exec_config # # config # end out.puts '--no-harm', 'only display what to do if given', 'off' out.printf " %-20s %s [%s]\n", out.puts 'Options for install:' out.puts '--rbconfig=path', 'your rbconfig.rb to load', "running ruby's" out.printf " %-20s %s [%s]\n", end default2 || default desc, '--'+ name + (ConfigTable.bool_config?(name) ? '' : '='+arg), out.printf " %-20s %s [%s]\n", ConfigTable.each_definition do |name, (default, arg, desc, default2)| out.puts 'Options for config:' out.puts end out.printf " %-10s %s\n", name, desc TASKS.each do |name, desc| out.puts 'Tasks:' out.puts out.printf fmt, '--copyright', 'print copyright and quit' out.printf fmt, '-v,--version', 'print version and quit' out.printf fmt, '-h,--help', 'print this message'adN2twWOD>:65srJ>* k Q 7   i f 2  Y ( h >  z O I H 7  9z]x[ f, = }732 ] 'does not compile/install ruby extentions' ] ] 'yes/no', [ 'without-ext', [ 'no', 'the make program to compile ruby extentions' ] ], 'name', [ 'make-prog', [ 'make', 'the ruby program using for installation' ] ], 'name', [ 'ruby-prog', [ rubypath, 'path to set to #! line' ] ], 'path', [ 'ruby-path', [ rubypath, 'the directory for shared data' ] ], 'path', [ 'data-dir', [ '$prefix/share', 'the directory for ruby extentions' ] ], 'path', [ 'so-dir', [ sodir, 'the directory for ruby scripts' ] ], 'path', [ 'rb-dir', [ '$site-ruby', 'the directory for commands' ] ], 'path', [ 'bin-dir', [ '$prefix/bin', 'the directory for non-standard ruby libraries' ] ], 'path', [ 'site-ruby', [ versite, 'the directory for version-independent non-standard ruby libraries' ] ], 'path', [ 'site-ruby-common', [ siteruby, 'the directory for standard ruby libraries' ] ], 'path', [ 'std-ruby', [ stdruby, 'path prefix of target environment' ] ], 'path', [ 'prefix', [ c['prefix'], DESCRIPTER = [ end sodir = "$site-ruby/#{c['arch']}" versite = siteruby siteruby = "$prefix/lib/ruby/#{version}/site_ruby" stdruby = "$prefix/lib/ruby/#{version}" # V < 1.4.4 else sodir = "$site-ruby/#{c['arch']}" versite = siteruby + '/' + version siteruby = subprefix.call(c['sitedir']) stdruby = "$prefix/lib/ruby/#{version}" # 1.4.4 <= V <= 1.6.3 elsif newpath_p then sodir = subprefix.call(c['sitearchdir']) versite = subprefix.call(c['sitelibdir']) siteruby = subprefix.call(c['sitedir']) stdruby = subprefix.call(c['rubylibdir']) # 1.6.3 < V if c['rubylibdir'] then } re === path and path.sub(re, '$prefix') subprefix = lambda {|path| re = Regexp.new('\A' + Regexp.quote(c['prefix'])) ((minor == 4) and (teeny >= 4))))) ((minor >= 5) or ((major == 1) and newpath_p = ((major >= 2) or # ruby ver. >= 1.4.4? version = "#{major}.#{minor}" teeny = c['TEENY'].to_i minor = c['MINOR'].to_i major = c['MAJOR'].to_i rubypath = c['bindir'] + '/' + c['ruby_install_name'] c = ::Config::CONFIGclass ConfigTablemodule InstallPkgend require 'rbconfig'else require file ARGV.delete_at(i) file = $'if i = ARGV.index(/\A--rbconfig=/) then### begin config.rb### end compat.rbend File.open(fname, 'wb') {|f| f.write str }def File.write( fname, str )end File.open(fname, 'rb') {|f| return f.read }def File.read_all( fname )endend end result end result = yield(result, i) each do |i| def inject( result )module Enumerableunless Enumerable.instance_methods.include? 'inject' then### begin compat.rbad ^XW+ A;: p B < ;  } | T *  x w k X A 9 1 0 #  _ E %    m e _ O N C  [4ga`F0*)hbaWVC.('f`_D"UON!WN ent = ConfigTable.get_entry(name) def remove_config( name ) end end ConfigTable.get_entry!(name)[0] = default else ConfigTable.get_entry!(name)[0] = default ? 'yes' : 'no' if bool_config? name then def set_config_default( name, default ) end add_config name, 'yes/no', default ? 'yes' : 'no', desc def add_bool_config( name, default, desc ) end add_config name, 'path', default, desc def add_path_config( name, default, desc ) end ConfigTable.add_entry name,[default,argname,desc] def add_config( name, argname, default, desc ) end ConfigTable.path_config? name def path_config?( name ) end ConfigTable.value_config? name def value_config?( name ) end ConfigTable.bool_config? name def bool_config?( name ) end ConfigTable.config_key? name def config?( name ) end ConfigTable.keys def config_names private end new.instance_eval File.read_all(file), file, 1 return unless File.file? file def self.eval_file( file )class MetaConfigEnvironmentend end @table[key] def get_raw( key ) end @table[key] = val def set_raw( key, val ) end @table[key].gsub( %r<\$([^/]+)> ) { self[$1] } @table[key] or return nil def []( key ) end end @table[k] = v else @table[k] = (v[0,1] != '$') ? File.expand_path(v) : v if ConfigTable.path_config? k then ConfigTable.config_key? k or raise InstallError, "unknown config option #{k}" def []=( k, v ) end } end f.printf "%s=%s\n", k, v if v @table.each do |k, v| File.open( SAVE_FILE, 'w' ) {|f| def save private :init end end @table[k] = default DESCRIPTER.each do |k, (default, vname, desc, default2)| def init end @table = {} def initialize end end c end } @table[k] = v.strip c.instance_eval { k, v = line.split( '=', 2 ) File.foreach( SAVE_FILE ) do |line| raise InstallError, "#{File.basename $0} config first" File.file? SAVE_FILE or c = newobj() def load end c c.__send__ :init c = newobj() def new alias newobj new class << self end ent[1] == 'path' ent = get_entry(name) or return false def ConfigTable.path_config?( name ) end ent[1] != 'yes/no' ent = get_entry(name) or return false def ConfigTable.value_config?( name ) end ent[1] == 'yes/no' ent = get_entry(name) or return false def ConfigTable.bool_config?( name ) end get_entry(name) ? true : false def ConfigTable.config_key?( name ) end DESCRIPTER.delete_if {|n,arr| n == name } get_entry name or raise ArgumentError, "no such config: #{name}" def ConfigTable.remove_entry( name ) end ConfigTable::DESCRIPTER.push [name,vals] def ConfigTable.add_entry( name, vals ) end get_entry(name) or raise ArgumentError, "no such config: #{name}" def ConfigTable.get_entry!( name ) end ent name, ent = DESCRIPTER.assoc(name) def ConfigTable.get_entry( name ) end DESCRIPTER.each( &block ) def ConfigTable.each_definition( &block ) end DESCRIPTER.collect {|k,*dummy| k } def ConfigTable.keys end keys().each( &block ) def ConfigTable.each_name( &block ) SAVE_FILE = 'config.save'adgB~fG?" q p ;   s [ B ,   | { e W M 3 ( P 9 8  q A 9  ^>87"}wvb?zyaF}IHG54pb\[Z54p]WVH-'&"   end @config[key] def get_config( key ) # # configs/options # end "#<#{type} #{__id__}>" def inspect end @currdir = '.' @objdir = File.expand_path(objroot) @srcdir = File.expand_path(srcroot) @options = opt @config = config def initialize( config, opt, srcroot, objroot ) include FileOperations FILETYPES = %w( bin lib ext data ) end @toplevel def self.toplevel_installer end @toplevel = inst raise ArgumentError, 'more than one toplevel installer decleared' @toplevel and def self.declear_toplevel_installer( inst ) @toplevel = nil Copyright = 'Copyright (c) 2000-2002 Minero Aoki' Version = '3.1.2'class Installerclass InstallError < StandardError; end### begin base.rb### end fileop.rbend end } return d.find_all {|n| dir? "#{dname}/#{n}" } - %w(. ..) Dir.open( dname ) {|d| def all_dirs( dname ) end } return d.find_all {|n| File.file? "#{dname}/#{n}" } Dir.open( dname ) {|d| def all_files( dname ) end File.directory?( (dname[-1,1] == '/') ? dname : dname + '/' ) # for corrupted windows stat() def dir?( dname ) end command config('ruby-prog') + ' ' + str def ruby( str ) end system str or raise RuntimeError, "'system #{str}' failed" $stderr.puts str if verbose? def command( str ) end orig != File.read_all(targ) return true unless File.exist? targ def diff?( orig, targ ) end end File.open( objdir + '/InstalledFiles', 'a' ) {|f| f.puts realdest } File.chmod mode, realdest File.write realdest, str } rm_f realdest if File.exist? realdest verbose_off { if diff? str, realdest then str = File.read_all(from) end realdest += '/' + File.basename(from) if dir? realdest then realdest = prefix + dest if prefix return if no_harm? $stderr.puts "install #{from} #{dest}" if verbose? def install( from, dest, mode, prefix = nil ) end rm_f src end File.chmod File.stat(src).mode, dest File.write dest, File.read_all(src) rescue File.link src, dest begin rm_f dest def mv( src, dest ) end Dir.rmdir dn Dir.chdir '..' end end } rm_f fn verbose_off { else } rm_rf fn verbose_off { if dir? fn then next if fn == '..' next if fn == '.' Dir.foreach('.') do |fn| Dir.chdir dn return if no_harm? $stderr.puts "rm -rf #{dn}" if verbose? def rm_rf( dn ) end end File.unlink fname File.chmod 0777, fname if File.exist? fname or File.symlink? fname then return if no_harm? $stderr.puts "rm -f #{fname}" if verbose? def rm_f( fname ) end end Dir.mkdir path unless dir? path path = dirs[0..idx].join('') dirs.each_index do |idx| end dirs[0] = disk + dirs[0] disk = dirs.shift if /\A[a-z]:\z/i === dirs[0] then dirs = dname.split(%r_(?=/)_) # does not check '/'... it's too abnormal case return if no_harm? $stderr.puts "mkdir -p #{dname}" if verbose? dname = prefix + dname if prefix def mkdir_p( dname, prefix = nil )module FileOperations### begin fileop.rb### end config.rbend end ent ConfigTable.remove_entry namead}|mUON<ihV932 x Z T S 7   ^ X R Q 4  N H B A * o \ R ?  } | ` Z Y =     pjie[WVE& srWlSwlB:43 b\[WKGF3  ICB% if extdir? curr_srcdir then def install_dir_ext( rel ) end install_files targfiles, config('rb-dir') + '/' + rel, 0644 def install_dir_lib( rel ) end install_files targfiles, config('bin-dir') + '/' + rel, 0755 def install_dir_bin( rel ) end exec_task_traverse 'install' def exec_install # # install # end def setup_dir_data( relpath ) end command config('make-prog') def make end end make if extdir? curr_srcdir then def setup_dir_ext( relpath ) end def setup_dir_lib( relpath ) end end rm_f tmpfile if File.exist? tmpfile ensure mv tmpfile, File.basename(path) } } w.write r.read w.print first.sub( SHEBANG_RE, '#!' + config('ruby-path') ) return unless SHEBANG_RE === first # reject '/usr/bin/env ruby' first = r.gets File.open( tmpfile, 'w' ) {|w| File.open( path ) {|r| begin tmpfile = File.basename(path) + '.tmp' return if no_harm? $stderr.puts %Q if verbose? def add_rubypath( path ) SHEBANG_RE = /\A\#!\s*\S*ruby\S*/ end end add_rubypath "#{curr_srcdir}/#{fname}" all_files( curr_srcdir ).each do |fname| def setup_dir_bin( relpath ) end exec_task_traverse 'setup' def exec_setup # # setup # end def config_dir_data( rel ) end command "#{config('ruby-prog')} #{curr_srcdir}/extconf.rb #{opt}" opt = @options['config-opt'].join(' ') def extconf end extconf if extdir? curr_srcdir def config_dir_ext( rel ) end def config_dir_lib( rel ) end def config_dir_bin( rel ) end exec_task_traverse 'config' def exec_config # # config # end @currdir = File.dirname(rel) $stderr.puts '<--- ' + rel if verbose? Dir.chdir save yield @currdir = rel $stderr.puts '---> ' + rel if verbose? Dir.chdir dir save = Dir.pwd Dir.mkdir dir unless dir? dir dir = File.basename(rel) return unless dir? "#{@srcdir}/#{rel}" def dive_into( rel ) end } dir? File.join(curr_srcdir, path, fname) srcentries(path).find_all {|fname| def srcdirectories( path = '.' ) end } File.file? File.join(curr_srcdir, path, fname) srcentries(path).find_all {|fname| def srcfiles( path = '.' ) end } return d.to_a - %w(. ..) - hookfilenames Dir.open( curr_srcdir + '/' + path ) {|d| def srcentries( path = '.' ) end File.file? srcfile(path) def srcfile?( path ) end dir? srcfile(path) def srcdirectory?( path ) end File.exist? srcfile(path) def srcexist?( path ) end curr_srcdir + '/' + path def srcfile( path ) end "#{@objdir}/#{@currdir}" def curr_objdir alias objdir_root objdir attr_reader :objdir end "#{@srcdir}/#{@currdir}" def curr_srcdir alias package_root srcdir alias srcdir_root srcdir attr_reader :srcdir # # srcdir/objdir # end @options['verbose'] = save yield save, @options['verbose'] = @options['verbose'], false def verbose_off end @options['verbose'] def verbose? end @options['no-harm'] def no_harm? end @config[key] = val def set_config( key, val ) alias config get_configad$`ZY;H@:7' V 9 3 - ,   k C  g a [ Z V L H G 6  v p m a    J u^?~xw`)VK dcW&`\[ZAtbB9 def run_metaconfigs end exectask task parsearg_TASK task end @config = ConfigTable.load else @config = ConfigTable.new when 'config' case task = option #was:case task = parsearg_global() run_metaconfigs def execute(option) end Installer.declear_toplevel_installer self super nil, {'verbose' => true}, root, '.' def initialize( root ) ] [ 'clean', "does `make clean' for each extention" ] [ 'install', 'installs files' ], [ 'setup', 'compiles extention or else' ], [ 'show', 'shows current configuration' ], [ 'config', 'saves your configurations' ], TASKS = [class ToplevelInstaller < Installer### begin toplevel.rb### end base.rbend end File.exist? dir + '/MANIFEST' def extdir?( dir ) end true end raise InstallError, "hook #{fname} failed:\n" + $!.message rescue env.instance_eval File.read_all(fname), fname, 1 begin env = self.dup return false unless File.file? fname def try_run_hook( fname ) end try_run_hook curr_srcdir + '/' + name + '.rb' try_run_hook curr_srcdir + '/' + name or def run_hook( name ) end } run_hook 'post-' + task end traverse task, rel + '/' + d, mid all_dirs( curr_srcdir ).each do |d| __send__ mid, rel.sub( %r_\A.*?(?:/|\z)_, '' ) run_hook 'pre-' + task dive_into( rel ) { def traverse( task, rel, mid ) end run_hook 'post-' + task end traverse task, type, task + '_dir_' + type end next $stderr.puts 'skipping ext/* by user option' if verbose? if config('without-ext') == 'yes' and type == 'ext' then FILETYPES.each do |type| run_hook 'pre-' + task def exec_task_traverse( task ) # # lib # end def clean_dir_data( rel ) end command config('make-prog') + ' clean' if File.file? 'Makefile' def clean end clean def clean_dir_ext( rel ) end def clean_dir_lib( rel ) end def clean_dir_bin( rel ) end rm_f 'InstalledFiles' rm_f 'config.save' exec_task_traverse 'clean' def exec_clean # # clean # end } return d.find_all {|fname| DLEXT === fname } Dir.open( dir ) {|d| def _allext( dir ) DLEXT = /\.#{ ::Config::CONFIG['DLEXT'] }\z/ end "no extention exists: Have you done 'ruby #{$0} setup' ?" _allext(dir) or raise InstallError, def allext( dir ) end }.flatten %w( config setup install clean ).collect {|t| sprintf fmt, t } %w( pre-%s post-%s pre-%s.rb post-%s.rb ).collect {|fmt| def hookfilenames end } ret | all_files(dir) [ curr_srcdir(), '.' ].inject([]) {|ret, dir| def targfilenames end } File.exist?(fname) ? fname : File.join(curr_srcdir(), fname) (targfilenames() - hookfilenames()).collect {|fname| def targfiles end end install fname, dest, mode, @options['install-prefix'] list.each do |fname| mkdir_p dest, @options['install-prefix'] def install_files( list, dest, mode ) end install_files targfiles, config('data-dir') + '/' + rel, 0644 def install_dir_data( rel ) end install_files allext('.'), config('so-dir') + '/' + rel, 0555 def install_dir_ext_main( rel ) end end install_dir_ext_main File.dirname(rel)ad2uZJA2*$#bVN v u W H 3 ~ [ Z @ $   { l k ` #    g T K 6 r 8     ;SvZRLK4qdI&rg,"GF-  out.printf fmt, ' --verbose', 'output messages verbosely' out.printf fmt, '-q,--quiet', 'suppress message outputs' out.puts 'Global options:' out.puts fmt = " %-20s %s\n" out.puts " ruby #{File.basename $0} [] []" out.puts " ruby #{File.basename $0} " out.puts 'Usage:' out.puts def print_usage( out ) end end end raise InstallError, "install: unknown option #{a}" else puts "prefix is: #{path}" @options['install-prefix'] = path path = File.expand_path(path) unless path[0,1] == '/' path = $1 when /\A--prefix=(.*)\z/ @options['no-harm'] = true when /\A--no-harm\z/ case a puts "argv.shift is: #{a}" while a = argv.shift do @options['install-prefix'] = '' @options['no-harm'] = false argv = ARGV.dup puts "parsearg_install!!! ARGV: #{ARGV}" def parsearg_install end end @config[name] = value end value = 'yes' ConfigTable.bool_config?(name) or raise InstallError, "config: --#{name} requires argument" else end value = (/\Ay(es)?|\At(rue)/i === value) ? 'yes' : 'no' /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i === value or raise InstallError, "config: --#{name} allows only yes/no for argument" if ConfigTable.bool_config?(name) then if value then name, value = m.to_a[1,2] m = re.match(i) or raise InstallError, "config: unknown option #{i}" end break @options['config-opt'] = ARGV.dup if /\A--?\z/ === i then while i = argv.shift do argv = ARGV.dup @options['config-opt'] = [] re = /\A--(#{ConfigTable.keys.join '|'})(?:=(.*))?\z/ def parsearg_config end #does nothing, needed for the parsearge_TASK above def parsearg_setup end end raise InstallError, "#{task}: unknown options: #{ARGV.join ' '}" ARGV.empty? or else __send__ mid if respond_to? mid, true then puts mid mid = "parsearg_#{task}" def parsearg_TASK( task ) end raise InstallError, 'no task or global option given' end end raise InstallError, "unknown global option '#{arg}'" else exit 0 puts Copyright when '--copyright' exit 0 puts "#{File.basename $0} version #{Version}" when '-v', '--version' exit 0 print_usage $stdout when '-h', '--help' @options['verbose'] = true when '--verbose' @options['verbose'] = false when '-q', '--quiet' return arg task_re === arg or raise InstallError, "wrong task: #{arg}" when /\A\w+\z/ case arg while arg = argv.shift do task_re = /\A(?:#{TASKS.collect {|i| i[0] }.join '|'})\z/ argv = ARGV.dup def parsearg_global # # processing arguments # end $stderr.printf "#{File.basename $0}: %s done.\n", task if verbose? end raise $stderr.printf "%s failed\n", task rescue __send__ 'exec_' + task begin $stderr.printf "#{File.basename $0}: entering %s phase...\n", task if verbose? def try( task ) end end try task else exec_show if task == 'show' then def exectask( task ) end 'metaconfig' def metaconfig end MetaConfigEnvironment.eval_file "#{srcdir_root}/#{metaconfig}"