lib/omnibus/packager.rb in omnibus-7.0.34 vs lib/omnibus/packager.rb in omnibus-8.0.9

- old
+ new

@@ -1,7 +1,7 @@ # -# Copyright 2014-2018 Chef Software, Inc. +# Copyright 2014-2020, Chef Software Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -64,28 +64,19 @@ # def for_current_system family = Ohai["platform_family"] version = Ohai["platform_version"] - if family == "solaris2" && Chef::Sugar::Constraints::Version.new(version).satisfies?(">= 5.11") + if family == "solaris2" && ChefUtils::VersionString.new(version).satisfies?(">= 5.11") family = "ips" - elsif family == "solaris2" && Chef::Sugar::Constraints::Version.new(version).satisfies?(">= 5.10") + elsif family == "solaris2" && ChefUtils::VersionString.new(version).satisfies?(">= 5.10") family = "solaris" end if klass = PLATFORM_PACKAGER_MAP[family] - package_types = klass.is_a?(Array) ? klass : [ klass ] - - if package_types.include?(APPX) && - !Chef::Sugar::Constraints::Version.new(version).satisfies?(">= 6.2") - log.warn(log_key) { "APPX generation is only supported on Windows versions 2012 and above" } - package_types -= [APPX] - end - - package_types + klass.is_a?(Array) ? klass : [ klass ] else log.warn(log_key) do - "Could not determine packager for `#{family}', defaulting " \ - "to `makeself'!" + "Could not determine packager for `#{family}`, defaulting to `makeself`!" end [Makeself] end end module_function :for_current_system