Class: BuildTool::Commands::Modules::Info

Inherits:
BuildTool::Commands::ModuleBasedCommand show all
Defined in:
lib/build-tool/commands/modules/info.rb

Overview

BuildCommand

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #parent

Instance Method Summary collapse

Methods inherited from BuildTool::Commands::ModuleBasedCommand

#clean, #clone, #configure, #do_execute, #fetch, #initialize, #install, #is_module_ready?, #make, #rebase, #reconfigure, #summarize

Methods inherited from Standard

#complete_modules, #initialize, #log_directory, #while_logging_to

Methods inherited from Base

#<=>, #applicable?, #cleanup_after_vcs_access, #complete, #complete_arguments, #complete_readline_1_8, #complete_readline_1_9, #configuration, #do_complete_1_8, #do_complete_1_9, #do_execute, #each_option, #execute, #fullname, #initialize, #log?, #say, #setup_command, #show_help, #skip_command, #summarize, #teardown_command, #usage

Methods included from HelpText

#cmdalias, #description, included, #long_description, #name

Constructor Details

This class inherits a constructor from BuildTool::Commands::ModuleBasedCommand

Instance Method Details

#do_execute_module(mod) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/build-tool/commands/modules/info.rb', line 13

def do_execute_module( mod )
    if mod.description
        say mod.description
        say ""
    else
        say "No description specified to the module"
        say ""
    end
    say mod.long_description if mod.long_description

    say "Active:            #{mod.active?}"

    if mod.repository
        say "Repository:        #{mod.repository.url}/#{mod.remote_path}"
        if mod.repository.sshkey
            say "  SSH Key:         '#{mod.repository.sshkey.name}' (#{mod.repository.sshkey.file})"
        end
        say "Apply Patches:     #{mod.patches.join(", ")}"
    else
        say "Repository:        not configured"
    end

    if mod.build_prefix
        say "Local Checkout:    #{mod.vcs.local_path} #{mod.checkedout? ? '(EXISTS)' : '(TODO)' }"
        say "Build Directory    #{mod.build_directory} #{mod.configured? ? '(CONFIGURED)' : '(TODO)' }"
    else
        say "Local Checkout:    build-prefix not configured"
    end

    say "Prefix:            #{mod.install_prefix.to_s}"
    if mod.environment
        say "Environment:"
        mod.environment.vars.sort.each do |var|
            say "  %-20s %s" % [ var + ":", mod.environment[var] ]
        end
    else
        say "Environment:       Not configured"
    end

    say "VCS: #{mod.vcs_configuration ? mod.vcs_configuration.name : 'not configured' }"
    if mod.vcs_configuration
        case mod.vcs_configuration.name
        when 'svn'
        when 'archive'
        when 'git'
            say "  Remote:       %s -> %s" % [ "origin", mod.vcs_configuration.repository.url ]
            mod.vcs_configuration.remote.each do |key, val|
                say "  Remote:       %s -> %s" % [ key, val.url ]
            end
            say "  Track branch: #{mod.vcs_configuration.track_remote}/#{mod.vcs_configuration.track_branch}"
        when 'git-svn'
            say "  Remote:       %s -> %s" % [ "git-svn", mod.vcs_configuration.repository.url ]
            mod.vcs_configuration.remote.each do |key, val|
                say "  Remote:       %s -> %s" % [ key, val.url ]
            end
            mod.vcs_configuration.externals.each do |key, val|
                say "  External:            #{key} -> #{val}"
            end
        else
            logger.warn "Unknown vcs #{mod.vcs_configuration.name}"
        end
    end # if mod.vcs_configuration

    bs = mod.build_system
    if bs
        say "Build System:               #{bs.name}"
        say "  Out Of Source Build       #{bs.out_of_source}"
        bs.option_names.sort.each do |var|
            say "  %-28s %s" % [ var + ":", bs[var] ]
        end
    else
        say "Build System:               Not configured"
    end

    return 0
end

#initialize_optionsObject



90
91
92
93
94
95
96
# File 'lib/build-tool/commands/modules/info.rb', line 90

def initialize_options
    @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
    options.on( "--all", "Include inactive modules." ) {
        @all = true
        }
    super
end