Class: Pkgr::Distributions::Sles

Inherits:
Base
  • Object
show all
Defined in:
lib/pkgr/distributions/sles.rb

Defined Under Namespace

Classes: SlesFpmCommand

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#build_dependencies, #buildpacks, #check, #crons_dir, #default_buildpack_list, #dependencies, #initialize, #initializers_for, #os, #postinstall_file, #postuninstall_file, #preinstall_file, #preuninstall_file, #slug, #target, #templates, #verify

Constructor Details

This class inherits a constructor from Pkgr::Distributions::Base

Instance Method Details

#fpm_command(build_dir) ⇒ Object



35
36
37
# File 'lib/pkgr/distributions/sles.rb', line 35

def fpm_command(build_dir)
  SlesFpmCommand.new(self, build_dir).command
end

#installer_dependenciesObject



26
27
28
29
30
31
32
33
# File 'lib/pkgr/distributions/sles.rb', line 26

def installer_dependencies
  if release.to_i > 11
    super.push("which").push("net-tools").uniq
  else
    # sles-11 already has which installed
    super.push("net-tools").uniq
  end
end

#package_install_command(packages) ⇒ Object



22
23
24
# File 'lib/pkgr/distributions/sles.rb', line 22

def package_install_command(packages)
  "sudo zypper refresh ; sudo zypper install -y #{packages.map{|package| "\"#{package}\""}.join(" ")}"
end

#package_test_command(package) ⇒ Object



18
19
20
# File 'lib/pkgr/distributions/sles.rb', line 18

def package_test_command(package)
  "rpm -qa '#{package}' | grep '#{package}' > /dev/null 2>&1"
end

#releaseObject

Only keep major digits



10
11
12
# File 'lib/pkgr/distributions/sles.rb', line 10

def release
  @release[/^[0-9]+/]
end

#runnerObject



14
15
16
# File 'lib/pkgr/distributions/sles.rb', line 14

def runner
  @runner ||= Runner.new("sysv", "lsb-3.1", "chkconfig")
end