Sha256: 66b0421ecb06bac586b9233519bad2e8b44c1084dd04e6708c5fe21a1adb7422

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

module Specinfra
  module Command
    class SmartOS < Solaris
      def check_installed(package, version=nil)
        cmd = "/opt/local/bin/pkgin list 2> /dev/null | grep -qw ^#{escape(package)}"
        if version
          cmd = "#{cmd}-#{escape(version)}"
        end
        cmd
      end

      def check_enabled(service, level=3)
        "svcs -l #{escape(service)} 2> /dev/null | grep -wx '^enabled.*true$'"
      end

      def check_running(service)
        "svcs -l #{escape(service)} status 2> /dev/null |grep -wx '^state.*online$'"
      end

      def get_package_version(package, opts=nil)
        "pkgin list | cut -f 1 -d ' ' | grep -E '^#{escape(package)}-([^-])+$' | grep -Eo '(\\.|\\w)+$'"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta6 lib/specinfra/command/smartos.rb
specinfra-2.0.0.beta5 lib/specinfra/command/smartos.rb
specinfra-2.0.0.beta4 lib/specinfra/command/smartos.rb
specinfra-2.0.0.beta3 lib/specinfra/command/smartos.rb
specinfra-2.0.0.beta2 lib/specinfra/command/smartos.rb