lib/autoproj/cli/update.rb in autoproj-2.0.3 vs lib/autoproj/cli/update.rb in autoproj-2.1.0.rc1

- old
+ new

@@ -10,11 +10,15 @@ if from = options[:from] options[:from] = Autoproj::InstallationManifest.from_workspace_root(from) end - if options[:aup] && !options[:all] && selection.empty? + if options[:no_deps_shortcut] + options[:deps] = false + end + + if options[:aup] && !options[:config] && !options[:all] && selection.empty? if Dir.pwd == ws.root_dir options[:all] = true else selection = [Dir.pwd] end @@ -53,22 +57,24 @@ update_packages = options[:all] || (has_explicit_selection && !selection.empty?) || (!has_explicit_selection && !options[:config] && !options[:autoproj]) + options[:bundler] = update_autoproj options[:autoproj] = update_autoproj options[:config] = update_config options[:packages] = update_packages return selection, options end def run(selected_packages, options) ws.manifest.accept_unavailable_osdeps = !options[:osdeps] - ws.setup ws.autodetect_operating_system(force: true) - + if options[:bundler] + ws.update_bundler + end if options[:autoproj] ws.update_autoproj end begin @@ -78,29 +84,30 @@ checkout_only: !options[:config] || options[:checkout_only], reset: options[:reset], keep_going: options[:keep_going], retry_count: options[:retry_count]) rescue ImportFailed => configuration_import_failure - if !options[:keep_going] || !options[:packages] + if !options[:keep_going] raise end ensure ws.config.save end - if !options[:packages] - return [], [], [] + if options[:packages] + command_line_selection, selected_packages = + finish_loading_configuration(selected_packages) + else + command_line_selection, selected_packages = [], PackageSelection.new end osdeps_options = normalize_osdeps_options( checkout_only: options[:checkout_only], osdeps_mode: options[:osdeps_mode], osdeps: options[:osdeps], osdeps_filter_uptodate: options[:osdeps_filter_uptodate]) - command_line_selection, selected_packages = - finish_loading_configuration(selected_packages) source_packages, osdep_packages, import_failure = update_packages( selected_packages, osdeps: options[:osdeps], osdeps_options: osdeps_options, from: options[:from], @@ -117,12 +124,11 @@ if options[:osdeps] && !osdep_packages.empty? ws.install_os_packages(osdep_packages, **osdeps_options) end - ws.export_env_sh(source_packages) - Autoproj.message " updated #{ws.root_dir}/#{Autoproj::ENV_FILENAME}", :green + export_env_sh if import_failure && configuration_import_failure raise ImportFailed.new(configuration_import_failure.original_errors + import_failure.original_errors) elsif import_failure raise import_failure @@ -191,25 +197,9 @@ rescue PackageImportFailed => import_failure if !keep_going raise end return import_failure.source_packages, import_failure.osdep_packages, import_failure - end - - def load_all_available_package_manifests - # Load the manifest for packages that are already present on the - # file system - ws.manifest.each_autobuild_package do |pkg| - if pkg.checked_out? - begin - ws.manifest.load_package_manifest(pkg.name) - rescue Interrupt - raise - rescue Exception => e - Autoproj.warn "cannot load package manifest for #{pkg.name}: #{e.message}" - end - end - end end def setup_update_from(other_root) manifest.each_autobuild_package do |pkg| if pkg.importer.respond_to?(:pick_from_autoproj_root)