mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Add conflicts_with property and use it for coreutils, tealdeer and tldr (#13252)
* Add PackageUtils.compatible? tests for min_glibc and max_glibc * Add conflicts_with property and use it for coreutils, tealdeer and tldr
This commit is contained in:
@@ -11,7 +11,7 @@ class PackageUtils
|
||||
end
|
||||
|
||||
def self.compatible?(pkg)
|
||||
return (pkg.compatibility.casecmp?('all') || pkg.compatibility.include?(ARCH)) && (pkg.min_glibc.nil? || (pkg.min_glibc <= LIBC_VERSION)) && (pkg.max_glibc.nil? || (pkg.max_glibc >= LIBC_VERSION))
|
||||
return (pkg.compatibility.casecmp?('all') || pkg.compatibility.include?(ARCH)) && (pkg.min_glibc.nil? || (pkg.min_glibc <= LIBC_VERSION)) && (pkg.max_glibc.nil? || (pkg.max_glibc >= LIBC_VERSION)) && !installed?(pkg.conflicts_with)
|
||||
end
|
||||
|
||||
def self.incompatible_reason(pkg)
|
||||
@@ -19,6 +19,7 @@ class PackageUtils
|
||||
reason.push "#{pkg.name.capitalize} is not compatible with #{ARCH}." if !pkg.compatibility.casecmp?('all') && !pkg.compatibility.include?(ARCH)
|
||||
reason.push "ChromeOS is currently running glibc #{LIBC_VERSION}, but the minimum version for #{pkg.name} is #{pkg.min_glibc}." if !pkg.min_glibc.nil? && (pkg.min_glibc >= LIBC_VERSION)
|
||||
reason.push "ChromeOS is currently running glibc #{LIBC_VERSION}, but the maximum version for #{pkg.name} is #{pkg.min_glibc}." if !pkg.max_glibc.nil? && (pkg.max_glibc.to_s <= LIBC_VERSION)
|
||||
reason.push "#{pkg.name.capitalize} conflicts with #{pkg.conflicts_with.capitalize}, which is currently installed." if installed?(pkg.conflicts_with)
|
||||
return reason
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user