Class: FPM::Fry::Plugin::Apt
- Inherits:
-
Object
- Object
- FPM::Fry::Plugin::Apt
- Defined in:
- lib/fpm/fry/plugin/apt.rb
Overview
Note:
experimental
Allows adding a debian repository.
Class Method Summary collapse
Instance Method Summary collapse
-
#repository(url, distribution, components, options = {}) ⇒ Object
Adds a debian repository.
Class Method Details
.apply(builder, &block) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fpm/fry/plugin/apt.rb', line 33 def self.apply(builder, &block) if builder.flavour != "debian" builder.logger.info('skipped apt plugin') return end dsl = self.new(builder) if block.arity == 1 block.call(dsl) else dsl.instance_eval(&block) end end |
Instance Method Details
#repository(url, distribution, components, options = {}) ⇒ Object
Adds a debian repository
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fpm/fry/plugin/apt.rb', line 21 def repository(url, distribution, components, = {} ) name = "#{url}-#{distribution}".gsub(/[^a-zA-Z0-9_\-]/,'-') source = ['deb'] source << '[trusted=yes]' source << url source << distribution source << Array(components).join(' ') @builder.before_dependencies do @builder.bash "echo '#{source.join(' ')}' >> /etc/apt/sources.list.d/#{name}.list && apt-get update -o Dir::Etc::sourcelist='sources.list.d/#{name}.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'" end end |