Sha256: 041c9454d944fbd01e7e39b40e30c4a40221c291d9020b4eeef773ba984062a3

Contents?: true

Size: 1.31 KB

Versions: 20

Compression:

Stored size: 1.31 KB

Contents

require 'autoproj/cli/inspection_tool'

module Autoproj
    module CLI
        class Clean < InspectionTool
            def validate_options(packages, options)
                packages, options = super
                if packages.empty? && !options[:all]
                    opt = BuildOption.new("", "boolean", {:doc => "this is going to clean all packages. Is that really what you want ?"}, nil)
                    if !opt.ask(false)
                        raise Interrupt
                    end
                end
                return packages, options
            end

            def run(selection, options = Hash.new)
                initialize_and_load
                packages, _ = normalize_command_line_package_selection(selection)
                source_packages, * = resolve_selection(
                    ws.manifest,
                    selection,
                    recursive: false,
                    ignore_non_imported_packages: true)
                if packages.empty?
                    raise ArgumentError, "no packages or OS packages match #{selection.join(" ")}"
                end

                source_packages.each do |pkg_name|
                    ws.manifest.find_autobuild_package(pkg_name).
                        prepare_for_rebuild
                end
            end
        end
    end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
autoproj-2.0.0.rc14 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc13 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc12 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc11 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc10 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc9 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc8 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc6 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc5 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc4 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc3 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc2 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc1 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b7 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b6 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b5 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b4 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b3 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b2 lib/autoproj/cli/clean.rb
autoproj-2.0.0.b1 lib/autoproj/cli/clean.rb