#
# setup.rb
#
# Copyright (c) 2000-2003 Minero Aoki <aamine@loveruby.net>
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU Lesser General Public License version 2.
#

def multipackage_install?
  FileTest.directory?(File.dirname($0) + '/packages')
end

require 'setup/compat'
require 'setup/fileop'
require 'setup/config'
require 'setup/base'
require 'setup/toplevel'

if $0 == __FILE__
  begin
    if multipackage_install?
      ToplevelInstallerMulti.invoke
    else
      ToplevelInstaller.invoke
    end
  rescue
    raise if $DEBUG
    $stderr.puts $!.message
    $stderr.puts "Try 'ruby #{$0} --help' for detailed usage."
    exit 1
  end
end
