Sha256: f5ed41dfd4759b6179a9b166636b6ed0111c5b4eb61abbdd64c5c590c0c696a3
Contents?: true
Size: 1.56 KB
Versions: 6
Compression:
Stored size: 1.56 KB
Contents
module Autoproj module PackageManagers #Package manger for OpenSuse and Suse (untested) class ZypperManager < ShellScriptManager def initialize(ws) super(ws, 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
6 entries across 6 versions & 1 rubygems