Skip to content

Commit

Permalink
Removed old useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgurance committed Jul 2, 2024
1 parent 29c3e0f commit b7dd6ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 259 deletions.
209 changes: 10 additions & 199 deletions ISM/CommandLine.cr
Original file line number Diff line number Diff line change
Expand Up @@ -770,38 +770,6 @@ module ISM
printErrorNotification(ISM::Default::CommandLine::ErrorApplyPatchText+patchName, error)
end

def notifyOfUpdateUserFileError(data : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorUpdateUserFileText+data, error)
end

def notifyOfUpdateGroupFileError(data : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorUpdateGroupFileText+data, error)
end

def notifyOfMakeLinkError(path : String, targetPath : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorMakeLinkText1 +
path +
ISM::Default::CommandLine::ErrorMakeLinkText2 +
targetPath, error)
end

def notifyOfMakeLinkFileExistError(path : String, targetPath : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorMakeLinkFileExistText1 +
path +
ISM::Default::CommandLine::ErrorMakeLinkFileExistText2 +
targetPath +
ISM::Default::CommandLine::ErrorMakeLinkFileExistText3, error)
end

def notifyOfMakeLinkUnknowTypeError(path : String, targetPath : String, linkType : Symbol, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorMakeLinkUnknowTypeText1 +
path +
ISM::Default::CommandLine::ErrorMakeLinkUnknowTypeText2 +
targetPath +
ISM::Default::CommandLine::ErrorMakeLinkUnknowTypeText3 +
linkType.to_s, error)
end

def notifyOfCopyFileError(path : String | Enumerable(String), targetPath : String, error = nil)
if path.is_a?(Enumerable(String))
path = path.join(",")
Expand All @@ -812,24 +780,6 @@ module ISM
targetPath, error)
end

def notifyOfCopyAllFilesFinishingError(path : String, destination : String,text : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorCopyAllFilesFinishingText1 +
text +
ISM::Default::CommandLine::ErrorCopyAllFilesFinishingText2 +
path +
ISM::Default::CommandLine::ErrorCopyAllFilesFinishingText3 +
destination, error)
end

def notifyOfCopyAllFilesRecursivelyFinishingError(path : String, destination : String,text : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorCopyAllFilesRecursivelyFinishingText1 +
text +
ISM::Default::CommandLine::ErrorCopyAllFilesRecursivelyFinishingText2 +
path +
ISM::Default::CommandLine::ErrorCopyAllFilesRecursivelyFinishingText3 +
destination, error)
end

def notifyOfCopyDirectoryError(path : String, targetPath : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorCopyDirectoryText1 +
path +
Expand All @@ -844,66 +794,6 @@ module ISM
printErrorNotification(ISM::Default::CommandLine::ErrorDeleteFileText+path, error)
end

def notifyOfReplaceTextAllFilesNamedError(path : String, filename : String, text : String, newText : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorReplaceTextAllFilesNamedText1 +
text +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesNamedText2 +
newText +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesNamedText3 +
filename +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesNamedText4 +
path, error)
end

def notifyOfReplaceTextAllFilesRecursivelyNamedError(path : String, filename : String, text : String, newText : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorReplaceTextAllFilesRecursivelyNamedText1 +
text +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesRecursivelyNamedText2 +
newText +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesRecursivelyNamedText3 +
filename +
ISM::Default::CommandLine::ErrorReplaceTextAllFilesRecursivelyNamedText4 +
path, error)
end

def notifyOfDeleteAllFilesFinishingError(path : String, text : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorDeleteAllFilesFinishingText1 +
text +
ISM::Default::CommandLine::ErrorDeleteAllFilesFinishingText2 +
path, error)
end

def notifyOfDeleteAllFilesRecursivelyFinishingError(path : String, text : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorDeleteAllFilesRecursivelyFinishingText1 +
text +
ISM::Default::CommandLine::ErrorDeleteAllFilesRecursivelyFinishingText2 +
path, error)
end

def notifyOfDeleteAllHiddenFilesError(path : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorDeleteAllHiddenFilesText+path, error)
end

def notifyOfDeleteAllHiddenFilesRecursivelyError(path : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorDeleteAllHiddenFilesRecursivelyText+path, error)
end

def notifyOfRunSystemCommandError(arguments : String, path = String.new, environment = Hash(String, String).new, environmentFilePath = String.new, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorRunSystemCommandText1 +
arguments +
ISM::Default::CommandLine::ErrorRunSystemCommandText2 +
path +
ISM::Default::CommandLine::ErrorRunSystemCommandText3 +
(environment.map { |key| key.join("=") }).join(" ") +
ISM::Default::CommandLine::ErrorRunSystemCommandText4 +
environmentFilePath,
error)
end

def notifyOfGenerateEmptyFileError(path : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorGenerateEmptyFileText+path, error)
end

def notifyOfMoveFileError(path : String | Enumerable(String), newPath : String, error = nil)
if path.is_a?(Enumerable(String))
path = path.join(",")
Expand All @@ -922,95 +812,16 @@ module ISM
printErrorNotification(ISM::Default::CommandLine::ErrorDeleteDirectoryText+directory, error)
end

def notifyOfDeleteDirectoryRecursivelyError(directory : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorDeleteDirectoryRecursivelyText+directory, error)
end

def notifyOfSetPermissionsError(path : String, permissions : Int, error = nil)
if path.is_a?(Enumerable(String))
path = path.join(",")
end
printErrorNotification( ISM::Default::CommandLine::ErrorSetPermissionsText1 +
permissions.to_s +
ISM::Default::CommandLine::ErrorSetPermissionsText2 +
path, error)
end

def notifyOfSetPermissionsRecursivelyError(path : String, permissions : Int, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorSetPermissionsRecursivelyText1 +
permissions.to_s +
ISM::Default::CommandLine::ErrorSetPermissionsRecursivelyText2 +
path, error)
end

def notifyOfSetOwnerError(path : String, uid : Int | String, gid : Int | String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorSetOwnerText1 +
uid.to_s +
ISM::Default::CommandLine::ErrorSetOwnerText2 +
gid.to_s +
ISM::Default::CommandLine::ErrorSetOwnerText3 +
path, error)
end

def notifyOfSetOwnerRecursivelyError(path : String, uid : Int | String, gid : Int | String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorSetOwnerRecursivelyText1 +
uid.to_s +
ISM::Default::CommandLine::ErrorSetOwnerRecursivelyText2 +
gid.to_s +
ISM::Default::CommandLine::ErrorSetOwnerRecursivelyText3 +
path, error)
end

def notifyOfFileReplaceTextError(filePath : String, text : String, newText : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorFileReplaceTextText1 +
text +
ISM::Default::CommandLine::ErrorFileReplaceTextText2 +
newText +
ISM::Default::CommandLine::ErrorFileReplaceTextText3 +
filePath, error)
end

def notifyOfFileReplaceLineContainingError(filePath : String, text : String, newLine : String, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorFileReplaceLineContainingText1 +
text +
ISM::Default::CommandLine::ErrorFileReplaceLineContainingText2 +
newLine +
ISM::Default::CommandLine::ErrorFileReplaceLineContainingText3 +
filePath, error)
end

def notifyOfReplaceTextAtLineNumberError(filePath : String, text : String, newText : String, lineNumber : UInt64, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorReplaceTextAtLineNumberText1 +
text +
ISM::Default::CommandLine::ErrorReplaceTextAtLineNumberText2 +
newText +
ISM::Default::CommandLine::ErrorReplaceTextAtLineNumberText3 +
filePath +
ISM::Default::CommandLine::ErrorReplaceTextAtLineNumberText4 +
lineNumber.to_s, error)
end

def notifyOfFileDeleteLineError(filePath : String, lineNumber : UInt64, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorFileDeleteLineText1 +
lineNumber.to_s +
ISM::Default::CommandLine::ErrorFileDeleteLineText2 +
filePath, error)
end

def notifyOfGetFileContentError(filePath : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorGetFileContentText+filePath, error)
end

def notifyOfFileWriteDataError(filePath : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorFileWriteDataText+filePath, error)
end

def notifyOfFileAppendDataError(filePath : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorFileAppendDataText+filePath, error)
end

def notifyOfFileUpdateContentError(filePath : String, error = nil)
printErrorNotification(ISM::Default::CommandLine::ErrorFileUpdateContentText+filePath, error)
def notifyOfRunSystemCommandError(arguments : String, path = String.new, environment = Hash(String, String).new, environmentFilePath = String.new, error = nil)
printErrorNotification( ISM::Default::CommandLine::ErrorRunSystemCommandText1 +
arguments +
ISM::Default::CommandLine::ErrorRunSystemCommandText2 +
path +
ISM::Default::CommandLine::ErrorRunSystemCommandText3 +
(environment.map { |key| key.join("=") }).join(" ") +
ISM::Default::CommandLine::ErrorRunSystemCommandText4 +
environmentFilePath,
error)
end

def notifyOfUpdateKernelOptionsDatabaseError(software : ISM::SoftwareInformation, error = nil)
Expand Down
64 changes: 4 additions & 60 deletions ISM/Default/CommandLine.cr
Original file line number Diff line number Diff line change
Expand Up @@ -47,75 +47,19 @@ module ISM
ErrorApplyPatchText = "Failed to apply the patch "
ErrorUpdateUserFileText = "Failed to update the user file with the data: "
ErrorUpdateGroupFileText = "Failed to update the group file with the data: "
ErrorMakeLinkText1 = "Failed to make symbolic link from "
ErrorMakeLinkText2 = " to "
ErrorMakeLinkFileExistText1 = "Failed to make symbolic link from "
ErrorMakeLinkFileExistText2 = " to "
ErrorMakeLinkFileExistText3 = ". A file already exist"
ErrorMakeLinkUnknowTypeText1 = "Failed to make symbolic link from "
ErrorMakeLinkUnknowTypeText2 = " to "
ErrorMakeLinkUnknowTypeText3 = ". Unknow link type: "
ErrorCopyFileText1 = "Failed to copy the file from "
ErrorCopyFileText2 = " to "
ErrorCopyAllFilesFinishingText1 = "Failed to copy all files name's finishing by "
ErrorCopyAllFilesFinishingText2 = " located at "
ErrorCopyAllFilesFinishingText3 = " to "
ErrorCopyAllFilesRecursivelyFinishingText1 = "Failed to copy recursively all files name's finishing by "
ErrorCopyAllFilesRecursivelyFinishingText2 = " located at "
ErrorCopyAllFilesRecursivelyFinishingText3 = " to "
ErrorCopyDirectoryText1 = "Failed to copy the directory from "
ErrorCopyDirectoryText2 = " to "
ErrorDeleteFileText = "Failed to delete the file "
ErrorDeleteAllHiddenFilesText = "Failed to delete hidden files in "
ErrorDeleteAllHiddenFilesRecursivelyText = "Failed to delete hidden files recursively in "
ErrorRunSystemCommandText1 = "Failed to run "
ErrorRunSystemCommandText2 = " in "
ErrorRunSystemCommandText3 = " with given environment "
ErrorRunSystemCommandText4 = " with the loaded environment file "
ErrorGenerateEmptyFileText = "Failed to generate the empty file "
ErrorMoveFileText1 = "Failed to move "
ErrorMoveFileText2 = " to "
ErrorMakeDirectoryText = "Failed to make directory "
ErrorReplaceTextAllFilesNamedText1 = "Failed to replace the line containing "
ErrorReplaceTextAllFilesNamedText2 = " to the content "
ErrorReplaceTextAllFilesNamedText3 = " in all files named "
ErrorReplaceTextAllFilesNamedText4 = " in the directory "
ErrorReplaceTextAllFilesRecursivelyNamedText1 = "Failed to replace the line containing "
ErrorReplaceTextAllFilesRecursivelyNamedText2 = " to the content "
ErrorReplaceTextAllFilesRecursivelyNamedText3 = " in all files named "
ErrorReplaceTextAllFilesRecursivelyNamedText4 = " in the directory "
ErrorDeleteAllFilesFinishingText1 = "Failed to delete all files name's finishing by "
ErrorDeleteAllFilesFinishingText2 = " located at "
ErrorDeleteAllFilesRecursivelyFinishingText1 = "Failed to delete recursively all files name's finishing by "
ErrorDeleteAllFilesRecursivelyFinishingText2 = " located at "
ErrorDeleteDirectoryText = "Failed to delete directory "
ErrorDeleteDirectoryRecursivelyText = "Failed to delete directory recursively "
ErrorSetPermissionsText1 = "Failed to set the permissions "
ErrorSetPermissionsText2 = " to the file "
ErrorSetPermissionsRecursivelyText1 = "Failed to set the permissions recursively "
ErrorSetPermissionsRecursivelyText2 = " at the path "
ErrorSetOwnerText1 = "Failed to set the owner uid:"
ErrorSetOwnerText2 = " and gid:"
ErrorSetOwnerText3 = " to the file "
ErrorSetOwnerRecursivelyText1 = "Failed to set the owner recursively uid:"
ErrorSetOwnerRecursivelyText2 = " and gid:"
ErrorSetOwnerRecursivelyText3 = " at the path "
ErrorFileReplaceTextText1 = "Failed to replace the occurence "
ErrorFileReplaceTextText2 = " to "
ErrorFileReplaceTextText3 = " in the file "
ErrorFileReplaceLineContainingText1 = "Failed to replace the line containing "
ErrorFileReplaceLineContainingText2 = " to the content "
ErrorFileReplaceLineContainingText3 = " in the file "
ErrorReplaceTextAtLineNumberText1 = "Failed to replace the text "
ErrorReplaceTextAtLineNumberText2 = " to the content "
ErrorReplaceTextAtLineNumberText3 = " in the file "
ErrorReplaceTextAtLineNumberText4 = " at the line number "
ErrorFileDeleteLineText1 = "Failed to delete the line number "
ErrorFileDeleteLineText2 = " in the file "
ErrorGetFileContentText = "Failed to get file content from "
ErrorFileWriteDataText = "Failed to write data to "
ErrorFileAppendDataText = "Failed to write data to "
ErrorFileUpdateContentText = "Failed to update file content in "
ErrorRunSystemCommandText1 = "Failed to run "
ErrorRunSystemCommandText2 = " in "
ErrorRunSystemCommandText3 = " with given environment "
ErrorRunSystemCommandText4 = " with the loaded environment file "
ErrorUpdateKernelOptionsDatabaseText = "Failed to update the option database for the kernel "
InextricableText = "ISM stopped due to an inextricable problem of dependencies with these softwares:"
MissingSelectedDependenciesText = "ISM stopped due to missing unique dependencies not selected yet:"
Expand Down

0 comments on commit b7dd6ff

Please sign in to comment.