From 58897d44952c67c6ed9922acdf66406d1e20ef27 Mon Sep 17 00:00:00 2001 From: Fulgurance Date: Tue, 2 Jul 2024 17:06:30 +0100 Subject: [PATCH] Added new function to return the curently selected kernel version --- ISM/Software.cr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ISM/Software.cr b/ISM/Software.cr index 24e2322d..8ff9c92f 100644 --- a/ISM/Software.cr +++ b/ISM/Software.cr @@ -78,6 +78,28 @@ module ISM return String.new end + def mainKernelVersion : String + settingInformation = ISM::SoftwareInformation.new + settingInformation.loadInformationFile(@information.settingsFilePath) + + settingInformation.uniqueDependencies.each do |uniqueDependency| + uniqueDependency.each do |entry| + + if settingInformation.uniqueDependencyIsEnabled(entry) + + settingInformation.dependencies(allowDeepSearch: true).each do |dependency| + if dependency.fullName.downcase == entry.downcase + return dependency.version + end + end + end + end + end + + #Exit and show a message that no kernel are selected ? + return String.new + end + def prepareKernelSourcesInstallation makeDirectoryNoChroot("#{builtSoftwareDirectoryPathNoChroot}#{Ism.settings.rootPath}usr/src/") moveFileNoChroot("#{workDirectoryPathNoChroot}/Sources","#{builtSoftwareDirectoryPathNoChroot}#{Ism.settings.rootPath}usr/src/#{@information.versionName.downcase}")