Sha256: d5a8d749fa1edc13a529cdb81765d8e478f34f3899035fdb05a98c5cee892d2b

Contents?: true

Size: 1.07 KB

Versions: 26

Compression:

Stored size: 1.07 KB

Contents

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

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

        def load(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

26 entries across 26 versions & 1 rubygems

Version Path
autoproj-1.10.2 lib/autoproj/installation_manifest.rb
autoproj-1.10.1 lib/autoproj/installation_manifest.rb
autoproj-1.10 lib/autoproj/installation_manifest.rb
autoproj-1.10.rc1 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc23 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc22 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc21 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc20 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc19 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc18 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc17 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc16 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc15 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc14 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc13 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc12 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc11 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc10 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc9 lib/autoproj/installation_manifest.rb
autoproj-1.9.7.rc7 lib/autoproj/installation_manifest.rb