lib/autoproj/cli/show.rb in autoproj-2.0.0.rc23 vs lib/autoproj/cli/show.rb in autoproj-2.0.0.rc24

- old
+ new

@@ -4,11 +4,11 @@ module Autoproj module CLI class Show < InspectionTool def run(user_selection, options = Hash.new) options = Kernel.validate_options options, - mainline: false + mainline: false, env: false initialize_and_load(mainline: options.delete(:mainline)) default_packages = ws.manifest.default_packages source_packages, osdep_packages, * = @@ -22,18 +22,18 @@ end load_all_available_package_manifests revdeps = ws.manifest.compute_revdeps source_packages.each do |pkg_name| - display_source_package(pkg_name, default_packages, revdeps) + display_source_package(pkg_name, default_packages, revdeps, env: options[:env]) end osdep_packages.each do |pkg_name| display_osdep_package(pkg_name, default_packages, revdeps) end end - def display_source_package(pkg_name, default_packages, revdeps) + def display_source_package(pkg_name, default_packages, revdeps, options = Hash.new) puts Autoproj.color("source package #{pkg_name}", :bold) pkg = ws.manifest.find_autobuild_package(pkg_name) if !File.directory?(pkg.srcdir) puts Autobuild.color(" this package is not checked out yet, the dependency information will probably be incomplete", :magenta) end @@ -75,9 +75,23 @@ display_common_information(pkg_name, default_packages, revdeps) puts " directly depends on: #{pkg.dependencies.sort.join(", ")}" puts " optionally depends on: #{pkg.optional_dependencies.sort.join(", ")}" puts " dependencies on OS packages: #{pkg.os_packages.sort.join(", ")}" + if options[:env] + puts " environment" + pkg.resolved_env.sort_by(&:first).each do |name, v| + values = v.split(File::PATH_SEPARATOR) + if values.size == 1 + puts " #{name}: #{values.first}" + else + puts " #{name}:" + values.each do |single_v| + puts " #{single_v}" + end + end + end + end end def display_osdep_package(pkg_name, default_packages, revdeps) puts Autoproj.color("the osdep '#{pkg_name}'", :bold) ws.os_package_resolver.resolve_os_packages([pkg_name]).each do |manager_name, packages|