Skip to content

Commit

Permalink
Commented temporary to check bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgurance committed Jul 14, 2024
1 parent 958871e commit 686ef44
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions ISM/Software.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module ISM
end

def recordSelectedKernel
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

settingInformation = ISM::SoftwareInformation.loadConfiguration(@information.settingsFilePath)

Expand Down Expand Up @@ -86,14 +86,14 @@ module ISM
end

def prepareKernelSourcesInstallation
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

makeDirectoryNoChroot("#{builtSoftwareDirectoryPathNoChroot}#{Ism.settings.rootPath}usr/src/")
moveFileNoChroot("#{workDirectoryPathNoChroot}/Sources","#{builtSoftwareDirectoryPathNoChroot}#{Ism.settings.rootPath}usr/src/#{@information.versionName.downcase}")
end

def download
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfDownload(@information)

Expand All @@ -109,15 +109,15 @@ module ISM
end

def downloadSources
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

downloadFile( @information.sourcesLink,
ISM::Default::Software::SourcesArchiveBaseName,
ISM::Default::Software::ArchiveExtensionName)
end

def downloadSourcesMd5sum
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

downloadFile( @information.sourcesMd5sumLink,
ISM::Default::Software::SourcesArchiveBaseName,
Expand All @@ -131,23 +131,23 @@ module ISM
end

def downloadPatches
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

downloadFile( @information.patchesLink,
ISM::Default::Software::PatchesArchiveBaseName,
ISM::Default::Software::ArchiveExtensionName)
end

def downloadPatchesMd5sum
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

downloadFile( @information.patchesMd5sumLink,
ISM::Default::Software::PatchesArchiveBaseName,
ISM::Default::Software::ArchiveMd5sumExtensionName)
end

def downloadFile(link : String, filename : String, fileExtensionName : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

originalLink = link
downloaded = false
Expand Down Expand Up @@ -228,7 +228,7 @@ module ISM
end

def getFileContent(filePath : String) : String
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
content = File.read(filePath)
Expand All @@ -240,7 +240,7 @@ module ISM
end

def check
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfCheck(@information)

Expand All @@ -251,21 +251,21 @@ module ISM
end

def checkSourcesMd5sum
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

checkFile( workDirectoryPathNoChroot+"/"+ISM::Default::Software::SourcesArchiveName,
getFileContent(workDirectoryPathNoChroot+"/"+ISM::Default::Software::SourcesMd5sumArchiveName).strip)
end

def checkPatchesMd5sum
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

checkFile( workDirectoryPathNoChroot+"/"+ISM::Default::Software::PatchesArchiveName,
getFileContent(workDirectoryPathNoChroot+"/"+ISM::Default::Software::PatchesMd5sumArchiveName).strip)
end

def checkFile(archive : String, md5sum : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

digest = Digest::MD5.new
digest.file(archive)
Expand All @@ -278,7 +278,7 @@ module ISM
end

def extract
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfExtract(@information)

Expand All @@ -289,21 +289,21 @@ module ISM
end

def extractSources
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

extractArchive(workDirectoryPathNoChroot+"/"+ISM::Default::Software::SourcesArchiveName, workDirectoryPathNoChroot)
moveFileNoChroot(workDirectoryPathNoChroot+"/"+@information.versionName,workDirectoryPathNoChroot+"/"+ISM::Default::Software::SourcesDirectoryName)
end

def extractPatches
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

extractArchive(workDirectoryPathNoChroot+"/"+ISM::Default::Software::PatchesArchiveName, workDirectoryPathNoChroot)
moveFileNoChroot(workDirectoryPathNoChroot+"/"+@information.versionName,workDirectoryPathNoChroot+"/"+ISM::Default::Software::PatchesDirectoryName)
end

def extractArchive(archivePath : String, destinationPath = workDirectoryPathNoChroot)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

process = Process.run( "tar -xf #{archivePath}",
shell: true,
Expand All @@ -315,7 +315,7 @@ module ISM
end

def patch
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfPatch(@information)

Expand All @@ -335,7 +335,7 @@ module ISM
end

def applyPatch(patch : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

process = Process.run( "patch -Np1 -i #{patch}",
error: :inherit,
Expand All @@ -348,7 +348,7 @@ module ISM
end

def prepare
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfPrepare(@information)

Expand All @@ -362,7 +362,7 @@ module ISM

#Special function to improve performance (Internal use only)
def copyDirectoryNoChroot(path : String, targetPath : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
FileUtils.cp_r(path, targetPath)
Expand All @@ -374,7 +374,7 @@ module ISM

#Special function to improve performance (Internal use only)
def deleteFileNoChroot(path : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
FileUtils.rm(path)
Expand All @@ -386,7 +386,7 @@ module ISM

#Special function to improve performance (Internal use only)
def moveFileNoChroot(path : String, newPath : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
FileUtils.mv(path, newPath)
Expand All @@ -398,7 +398,7 @@ module ISM

#Special function to improve performance (Internal use only)
def makeDirectoryNoChroot(directory : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
FileUtils.mkdir_p(directory)
Expand All @@ -410,7 +410,7 @@ module ISM

#Special function to improve performance (Internal use only)
def deleteDirectoryNoChroot(directory : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

begin
FileUtils.rm_r(directory)
Expand All @@ -421,7 +421,7 @@ module ISM
end

def runChrootTasks(chrootTasks) : Process::Status
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

File.write(Ism.settings.rootPath+ISM::Default::Filename::Task, chrootTasks)

Expand Down Expand Up @@ -1184,7 +1184,7 @@ module ISM
end

def prepareOpenrcServiceInstallation(path : String, name : String)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

servicesPath = "/etc/init.d/"

Expand Down Expand Up @@ -1285,7 +1285,7 @@ module ISM
end

def recordInstallationInformation : Tuple(UInt128, UInt128, UInt128, UInt128)
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

directoryNumber = UInt128.new(0)
symlinkNumber = UInt128.new(0)
Expand Down Expand Up @@ -1322,7 +1322,7 @@ module ISM
end

def install
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfInstall(@information)

Expand Down Expand Up @@ -1581,7 +1581,7 @@ module ISM
end

def updateKernelOptionsDatabase
Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")
#Ism.recordSystemCall(command: "#{{% @def.receiver %}}.#{{% @def.name %}}")

Ism.notifyOfUpdateKernelOptionsDatabase(Ism.selectedKernel)

Expand Down

0 comments on commit 686ef44

Please sign in to comment.