Sha256: 43ba3361fb9a58a76008c4ad11815af153ccefe940cb4f0321633092989f4250

Contents?: true

Size: 1.26 KB

Versions: 49

Compression:

Stored size: 1.26 KB

Contents

module Autoproj
    # Manifest of installed packages imported from another autoproj installation
    class InstallationManifest
        Package = Struct.new :name, :srcdir, :prefix

        DEFAULT_MANIFEST_NAME = ".autoproj-installation-manifest"

        attr_reader :path
        attr_reader :packages
        def initialize(path)
            @path = path
        end

        def default_manifest_path
            File.join(path, DEFAULT_MANIFEST_NAME)
        end
            
        def load(path = default_manifest_path)
            @packages = CSV.read(path).map do |row|
                Package.new(*row)
            end
        end

        def each(&block)
            packages.each(&block)
        end

        def [](name)
            packages.find { |pkg| pkg.name == name }
        end

        def self.from_root(root_dir)
            manifest = InstallationManifest.new(root_dir)
            manifest_file = File.join(root_dir,  ".autoproj-installation-manifest")
            if !File.file?(manifest_file)
                raise ConfigError.new, "no .autoproj-installation-manifest file exists in #{root_dir}. You should probably rerun autoproj envsh in that folder first"
            end
            manifest.load(manifest_file)
            manifest
        end
    end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
autoproj-1.13.7 lib/autoproj/installation_manifest.rb
autoproj-1.13.6 lib/autoproj/installation_manifest.rb
autoproj-1.13.5 lib/autoproj/installation_manifest.rb
autoproj-1.13.5.rc1 lib/autoproj/installation_manifest.rb
autoproj-1.13.4 lib/autoproj/installation_manifest.rb
autoproj-1.13.3 lib/autoproj/installation_manifest.rb
autoproj-1.13.3.b2 lib/autoproj/installation_manifest.rb
autoproj-1.13.3.b1 lib/autoproj/installation_manifest.rb
autoproj-1.13.2.b4 lib/autoproj/installation_manifest.rb
autoproj-1.13.2.b3 lib/autoproj/installation_manifest.rb
autoproj-1.13.2.b2 lib/autoproj/installation_manifest.rb
autoproj-1.13.2.b1 lib/autoproj/installation_manifest.rb
autoproj-2.0.0.b1 lib/autoproj/installation_manifest.rb
autoproj-1.13.2 lib/autoproj/installation_manifest.rb
autoproj-1.13.1 lib/autoproj/installation_manifest.rb
autoproj-1.13.0 lib/autoproj/installation_manifest.rb
autoproj-1.12.6 lib/autoproj/installation_manifest.rb
autoproj-1.13.0.b8 lib/autoproj/installation_manifest.rb
autoproj-1.13.0.b7 lib/autoproj/installation_manifest.rb
autoproj-1.13.0.b6 lib/autoproj/installation_manifest.rb