Sha256: c3de656381538be6b0e11d2fd64522ee294f4e8babe7e2792ac5f6e0593bbe2a
Contents?: true
Size: 1.73 KB
Versions: 20
Compression:
Stored size: 1.73 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) 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, filter_uptodate_packages: false, install_only: false) if filter_uptodate_packages || install_only packages = filter_uptodate_packages(packages) end 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
20 entries across 20 versions & 1 rubygems