Sha256: 4e26d0dd6343b39cc126471dcd0ea90ce0da9940b9c6dfa83902dbcc3ba55df7

Contents?: true

Size: 1.28 KB

Versions: 23

Compression:

Stored size: 1.28 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(
                    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

23 entries across 23 versions & 1 rubygems

Version Path
autoproj-2.0.0.rc37 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc36 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc35 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc34 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc33 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc32 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc31 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc30 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc29 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc28 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc27 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc26 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc25 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc24 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc23 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc22 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc21 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc20 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc19 lib/autoproj/cli/clean.rb
autoproj-2.0.0.rc18 lib/autoproj/cli/clean.rb