Sha256: 44d6dec4903017e4d1c705cff37d306f36893e32ad910cc1481a7891447a2c8a
Contents?: true
Size: 1.81 KB
Versions: 40
Compression:
Stored size: 1.81 KB
Contents
module VagrantPlugins module GuestALT module Cap class Flavor def self.flavor(machine) comm = machine.communicate # Read the version file if comm.test("test -f /etc/os-release") name = nil comm.sudo("grep NAME /etc/os-release") do |type, data| if type == :stdout name = data.split("=")[1].gsub!(/\A"|"\Z/, '') end end if !name.nil? and name == "Sisyphus" return :alt end version = nil comm.sudo("grep VERSION_ID /etc/os-release") do |type, data| if type == :stdout verstr = data.split("=")[1] if verstr == "p8" version = 8 elsif verstr =~ /^[[\d]]/ version = verstr.chomp.to_i subversion = verstr.chomp.split(".")[1].to_i if subversion > 90 version += 1 end end end end if version.nil? or version == 0 return :alt else return :"alt_#{version}" end else output = "" comm.sudo("cat /etc/altlinux-release") do |_, data| output = data end # Detect various flavors we care about if output =~ /(ALT SP|ALT Education|ALT Workstation|ALT Workstation K|ALT Linux starter kit)\s*8(\.[1-9])?( .+)?/i return :alt_8 elsif output =~ /ALT\s+8(\.[1-9])?( .+)?\s.+/i return :alt_8 elsif output =~ /ALT Linux p8( .+)?/i return :alt_8 else return :alt end end end end end end end
Version data entries
40 entries across 36 versions & 5 rubygems