lib/specinfra/command/debian/base/package.rb in specinfra-2.0.0.beta37 vs lib/specinfra/command/debian/base/package.rb in specinfra-2.0.0.beta38

- old
+ new

@@ -10,11 +10,16 @@ cmd end alias :check_is_installed_by_apt :check_is_installed - def install(package) - "DEBIAN_FRONTEND='noninteractive' apt-get -y install #{package}" + def install(package, version=nil) + if version + full_package = "#{package}=#{version}" + else + full_package = package + end + "DEBIAN_FRONTEND='noninteractive' apt-get -y install #{full_package}" end def get_version(package, opts=nil) "dpkg-query -f '${Status} ${Version}' -W #{package} | sed -n 's/^install ok installed //p'" end