Sha256: e04cb2e27b4d5b4a23c6a413773ab2059185eae043c86f5df18e24cf2de9c558

Contents?: true

Size: 781 Bytes

Versions: 69

Compression:

Stored size: 781 Bytes

Contents

class Specinfra::Command::Arch::Base::Package < Specinfra::Command::Linux::Base::Package
  class << self
    def check_is_installed(package,version=nil)
      if version
        grep = version.include?('-') ? "^#{escape(version)}$" : "^#{escape(version)}-"
        "pacman -Q #{escape(package)} | awk '{print $2}' | grep '#{grep}'"
      else
        "pacman -Q #{escape(package)}"
      end
    end

    def get_version(package, opts=nil)
      "pacman -Qi #{package} | grep Version | awk '{print $3}'"
    end

    def install(package, version=nil, option='')
      # Pacman doesn't support to install specific version.
      "pacman -S --noconfirm #{option} #{package}"
    end

    # Should this method be here or not ?
    def sync_repos
      "pacman -Syy"
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
specinfra-2.18.1 lib/specinfra/command/arch/base/package.rb
specinfra-2.18.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.17.1 lib/specinfra/command/arch/base/package.rb
specinfra-2.17.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.16.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.15.2 lib/specinfra/command/arch/base/package.rb
specinfra-2.15.1 lib/specinfra/command/arch/base/package.rb
specinfra-2.15.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.14.4 lib/specinfra/command/arch/base/package.rb
specinfra-2.14.3 lib/specinfra/command/arch/base/package.rb
specinfra-2.14.2 lib/specinfra/command/arch/base/package.rb
specinfra-2.14.1 lib/specinfra/command/arch/base/package.rb
specinfra-2.14.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.13.1 lib/specinfra/command/arch/base/package.rb
specinfra-2.13.0 lib/specinfra/command/arch/base/package.rb
specinfra-2.12.7 lib/specinfra/command/arch/base/package.rb
specinfra-2.12.6 lib/specinfra/command/arch/base/package.rb
specinfra-2.12.5 lib/specinfra/command/arch/base/package.rb
specinfra-2.12.4 lib/specinfra/command/arch/base/package.rb
specinfra-2.12.3 lib/specinfra/command/arch/base/package.rb