Sha256: 2da305c272722a6eb6490d4e54b7dc87e3c19134ced48ef40cd40faecbdaf8ed

Contents?: true

Size: 1007 Bytes

Versions: 1

Compression:

Stored size: 1007 Bytes

Contents

require 'autobuild/config'
require 'autobuild/subcommand'
require 'autobuild/importer'

module Autobuild
    class DarcsImporter < Importer
        def initialize(source, options = {})
            @source   = source
            @program  = Autobuild.tool('darcs')
            super(options)
	    @pull = [*options[:pull]]
	    @get = [*options[:get]]
        end
        
        private

        def update(package)
	    if !File.directory?( File.join(package.srcdir, '_darcs') )
		raise ConfigException, "#{package.srcdir} is not a Darcs repository"
	    end

	    Subprocess.run(package.name, :import, @program, 
	       'pull', '--all', "--repodir=#{package.srcdir}", '--set-scripts-executable', @source, *@pull)
        end

        def checkout(package)
	    Subprocess.run(package.name, :import, @program, 
	       'get', '--set-scripts-executable', @source, package.srcdir, *@get)
        end
    end

    def self.darcs(source, options = {})
        DarcsImporter.new(source, options)
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
autobuild-0.6.4 lib/autobuild/import/darcs.rb