Sha256: 60504c8cd80f5815463b6a79722592c80a8ed3733e63b4948027fedc866bbad4

Contents?: true

Size: 909 Bytes

Versions: 152

Compression:

Stored size: 909 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)} || pacman -Qg #{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

    def remove(package, option='')
      "pacman -R --noconfirm #{option} #{package}"
    end
  end
end

Version data entries

152 entries across 152 versions & 1 rubygems

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