Sha256: e0b38d3451c6836ba3ef4d4e59154d6c5cdaccd671213931c415ae46e11fc340

Contents?: true

Size: 847 Bytes

Versions: 113

Compression:

Stored size: 847 Bytes

Contents

class Specinfra::Command::Freebsd::Base::Package < Specinfra::Command::Base::Package
  class << self
    def check_is_installed(package, version=nil)
      if version
        "pkg query %v #{escape(package)} | grep -- #{escape(version)}"
      else
        "pkg info -e #{escape(package)}"
      end
    end

    alias :check_is_installed_by_pkg :check_is_installed

    def check_is_installed_by_rpm(package, version=nil)
      cmd = "rpm -q #{escape(package)}"
      if version
        cmd = "#{cmd} | grep -w -- #{escape(package)}-#{escape(version)}"
      end
      cmd
    end

    alias :check_is_installed_by_yum :check_is_installed_by_rpm

    def install(package, version=nil, option='')
      "pkg install -y #{option} #{package}"
    end

    def get_version(package, opts=nil)
      "pkg query %v #{escape(package)}"
    end
  end
end

Version data entries

113 entries across 113 versions & 1 rubygems

Version Path
specinfra-2.91.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.90.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.90.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.89.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.88.2 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.88.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.88.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.87.2 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.87.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.87.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.86.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.85.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.85.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.84.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.84.0 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.83.4 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.83.3 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.83.2 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.83.1 lib/specinfra/command/freebsd/base/package.rb
specinfra-2.83.0 lib/specinfra/command/freebsd/base/package.rb