Class: Autoproj::CLI::Patcher

Inherits:
InspectionTool show all
Defined in:
lib/autoproj/cli/patcher.rb

Overview

Interface to patch/unpatch a package

Instance Attribute Summary

Attributes inherited from Base

#ws

Instance Method Summary collapse

Methods inherited from InspectionTool

#finalize_setup, #initialize_and_load

Methods inherited from Base

#export_env_sh, #initialize, #normalize_command_line_package_selection, #notify_env_sh_updated, #resolve_selection, #resolve_user_selection, validate_options, #validate_options, #validate_user_selection

Methods included from Ops::Tools

#common_options, #create_autobuild_package, #load_autoprojrc, #load_main_initrb

Constructor Details

This class inherits a constructor from Autoproj::CLI::Base

Instance Method Details

#run(packages, patch: true) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/autoproj/cli/patcher.rb', line 6

def run(packages, patch: true)
    initialize_and_load
    packages, = finalize_setup(packages, recursive: false, non_imported_packages: :ignore)
    packages.each do |package_name|
        pkg = ws.manifest.package_definition_by_name(package_name)
        if patch
            pkg.autobuild.importer.patch(pkg.autobuild)
        else
            pkg.autobuild.importer.patch(pkg.autobuild, [])
        end
    end
end