Class: Autoproj::CLI::StandaloneCI

Inherits:
Thor
  • Object
show all
Defined in:
lib/autoproj/cli/standalone_ci.rb

Overview

CI-related commands that can be executed without an Autoproj installation

Direct Known Subclasses

MainCI

Instance Method Summary collapse

Instance Method Details

#dpkg_filter_status(status_path, *rules) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/autoproj/cli/standalone_ci.rb', line 50

def dpkg_filter_status(status_path, *rules)
    rules += File.readlines(options[:file]).map(&:strip) if options[:file]
    rules = rules.map do |line|
        next if line.empty? || line.start_with?('#')

        parse_rule(line)
    end

    packages = Autoproj::CI::Rebuild.dpkg_create_package_install(
        status_path, rules, orig: options[:orig]
    )
    puts packages.join("\n")
end

#rebuild_root(config_dir, cache_root, output) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/autoproj/cli/standalone_ci.rb', line 20

def rebuild_root(config_dir, cache_root, output)
    dir = Dir.mktmpdir
    Autoproj::CI::Rebuild.prepare_synthetic_buildroot(
        File.join(config_dir, 'installation-manifest'),
        File.join(config_dir, 'versions.yml'),
        cache_root,
        dir
    )

    if options[:workspace]
        prepare_workspace(config_dir, dir, options[:workspace])
    end

    output = File.expand_path(output)
    unless system('tar', 'caf', output, '--owner=root', '--group=root',
                  '.', chdir: dir)
        raise "failed to create #{output}"
    end
ensure
    FileUtils.rm_rf(dir) if dir && File.directory?(dir)
end