Sha256: 0658ad1d4c998117c20407ffa30b2f0edc7767d844b31a28ebfd2c4a029c312e
Contents?: true
Size: 1.56 KB
Versions: 3
Compression:
Stored size: 1.56 KB
Contents
module Autoproj module PackageManagers #Package manger for OpenSuse and Suse (untested) class ZypperManager < ShellScriptManager def initialize super(['zypper'], true, "zypper install '%s'", "zypper -n install '%s'") end def filter_uptodate_packages(packages, options = Hash.new) result = `LANG=C rpm -q --whatprovides '#{packages.join("' '")}'` has_all_pkgs = $?.success? if !has_all_pkgs return packages # let zypper filter, we need root now anyways else return [] end end def install(packages) patterns, packages = packages.partition { |pkg| pkg =~ /^@/ } patterns = patterns.map { |str| str[1..-1] } result = false if !patterns.empty? result |= super(patterns, :auto_install_cmd => "zypper --non-interactive install --type pattern '%s'", :user_install_cmd => "zypper install --type pattern '%s'") end if !packages.empty? result |= super(packages) end if result # Invalidate caching of installed packages, as we just # installed new packages ! @installed_packages = nil end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems