Sha256: 6f3f0350e721a2847517dc3c950ce6d0e656b0c4d08ac01b438e6871f599ea8b
Contents?: true
Size: 987 Bytes
Versions: 39
Compression:
Stored size: 987 Bytes
Contents
module SpecInfra module Command class Debian < Linux def check_enabled(service, level=3) # Until everything uses Upstart, this needs an OR. "ls /etc/rc#{level}.d/ | grep -- '^S..#{escape(service)}' || grep 'start on' /etc/init/#{escape(service)}.conf" end def check_installed(package, version=nil) escaped_package = escape(package) if version cmd = "dpkg-query -f '${Status} ${Version}' -W #{escaped_package} | grep -E '^install ok installed #{escape(version)}$'" else cmd = "dpkg-query -f '${Status}' -W #{escaped_package} | grep '^install ok installed$'" end cmd end alias :check_installed_by_apt :check_installed def install(package) "apt-get -y install #{package}" end def get_package_version(package, opts=nil) "dpkg-query -f '${Status} ${Version}' -W #{package} | sed -n 's/^install ok installed //p'" end end end end
Version data entries
39 entries across 39 versions & 1 rubygems