Sha256: eb56cba66f5fc8722de924bd627e69c061a60151eea91b59b2d63eedb61b2e95

Contents?: true

Size: 1.68 KB

Versions: 45

Compression:

Stored size: 1.68 KB

Contents

module Autoproj
    module AutobuildExtensions
        module ArchiveImporter
            # Reconfigures this importer to use an already existing checkout located
            # in the given autoproj root
            #
            # @param [Autobuild::Package] the package we are dealing with
            # @param [Autoproj::InstallationManifest] the other root's installation
            #   manifest
            def pick_from_autoproj_root(package, installation_manifest)
                # Get the cachefile w.r.t. the autoproj root
                cachefile = Pathname.new(self.cachefile).
                    relative_path_from(Pathname.new(ws.root_dir)).to_s

                # The cachefile in the other autoproj installation
                other_cachefile = File.join(installation_manifest.path, cachefile)
                if File.file?(other_cachefile)
                    self.relocate("file://" + other_cachefile)
                    true
                end
            end

            def snapshot(package, target_dir = nil, options = Hash.new)
                result = Hash[
                    'mode' => mode,
                    'no_subdirectory' => !has_subdirectory?,
                    'archive_dir' => archive_dir || tardir]

                if target_dir
                    archive_dir = File.join(target_dir, 'archives')
                    FileUtils.mkdir_p archive_dir
                    FileUtils.cp @cachefile, archive_dir

                    result['url'] = "file://$AUTOPROJ_SOURCE_DIR/archives/#{File.basename(@cachefile)}"
                else
                    result['url'] = @url.to_s
                end
                
                result
            end
        end
    end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
autoproj-2.7.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.6.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.6.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.5.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.5.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.5.0.pre1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.4.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.3.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.3.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.2.2 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.2.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.2.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.1.2 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.1.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.1.0 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.1.0.rc1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.0.3 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.0.2 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.0.1 lib/autoproj/autobuild_extensions/archive_importer.rb
autoproj-2.0.0 lib/autoproj/autobuild_extensions/archive_importer.rb