Class: Debian::Build::GitExportProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/debian/build/source_providers.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ GitExportProvider

Returns a new instance of GitExportProvider.



148
149
150
# File 'lib/debian/build/source_providers.rb', line 148

def initialize(&block)
  @user_logic = block
end

Instance Method Details

#git_repositoryObject



152
153
154
# File 'lib/debian/build/source_providers.rb', line 152

def git_repository
  Rake.original_dir
end

#retrieve(package) ⇒ Object



156
157
158
159
160
161
162
# File 'lib/debian/build/source_providers.rb', line 156

def retrieve(package)
  mkdir_p package.source_directory
  Dir.chdir(git_repository) do
    sh "git archive HEAD | tar -xf - -C #{package.source_directory}"
    @user_logic.call package.source_directory if @user_logic
  end
end