install-eclipse.rb
def install_plugins(plugins)
  puts "*** Installing #{plugins.size} plugins"

  puts "** Checking existing plugins"
  not_installed = filter_installed_plugins(plugins)
  puts "** #{plugins.size - not_installed.size} plugins installed. Installing remaining #{not_installed.size}"

  not_installed.each do |package|
    pkg = package[:pkg]
    url = package[:url]
    puts "** Installing #{pkg} from #{url}"
    human_name = pkg.split('/').first
    cmd = <<END
#{ECLIPSE_BIN_PATH} -nosplash -application org.eclipse.equinox.p2.director \
 -repository '#{url}' \
 -installIU '#{pkg}' \
 -tag #{human_name}
END
    out = run_and_check_err(cmd)
    puts out
    still_not_installed = filter_installed_plugins([ package ])
    if still_not_installed.size > 0 then
      $stderr.puts "ERROR #{package[:pkg]} did not install correctly"
      exit 1
    end
  end
end
# Install the plugins we want. To make matters simpler, the plugins are
# installed one at a time, and are tagged between each installation in
# order to provide some measure of debuggability if (when) things go wrong.
Install the plugins we want. To make matters simpler, the plugins are
installed one at a time, and are tagged between each installation in
order to provide some measure of debuggability if (when) things go wrong.
Install the plugins we want . To make matters simpler the plugins are installed one at a time and are tagged between each installation in order to provide some measure of debuggability if ( when ) things go wrong .
def install_plugins(plugins)
  puts "*** Installing #{plugins.size} plugins"
  puts "** Checking existing plugins"
  not_installed = filter_installed_plugins(plugins)
  puts "** #{plugins.size - not_installed.size} plugins installed. Installing remaining #{not_installed.size}"
  not_installed.each do |package|
    pkg = package[:pkg]
    url = package[:url]
    puts "** Installing #{pkg} from #{url}"
    human_name = pkg.split('/').first
    cmd = <<END
#{ECLIPSE_BIN_PATH} -nosplash -application org.eclipse.equinox.p2.director \
 -repository '#{url}' \
 -installIU '#{pkg}' \
 -tag #{human_name}
END
    out = run_and_check_err(cmd)
    puts out
    still_not_installed = filter_installed_plugins([ package ])
    if still_not_installed.size > 0 then
      $stderr.puts "ERROR #{package[:pkg]} did not install correctly"
      exit 1
    end
  end
end
def install_plugins ( plugins ) puts "*** Installing #{plugins.size} plugins" puts "** Checking existing plugins" not_installed = filter_installed_plugins ( plugins ) puts "** #{plugins.size - not_installed.size} plugins installed. Installing remaining #{not_installed.size}" not_installed . each do | package | pkg = package [ :pkg ] url = package [ :url ] puts "** Installing #{pkg} from #{url}" human_name = pkg . split ( '/' ) . first cmd = <<END #{ ECLIPSE_BIN_PATH }  -nosplash -application org.eclipse.equinox.p2.director  \
  -repository ' #{ url } '  \
  -installIU ' #{ pkg } '  \
  -tag  #{ human_name } END out = run_and_check_err ( cmd ) puts out still_not_installed = filter_installed_plugins ( [ package ] ) if still_not_installed . size > 0 then $stderr . puts "ERROR #{package[:pkg]} did not install correctly" exit 1 end end end
Install the plugins we want.
Install the plugins we want .
plugins