@@ -45,13 +45,13 @@ class InstallationProgressTracker
4545 {
4646 let package : BrewPackage = packageBeingInstalled. package
4747
48- AppConstants . shared. logger. debug ( " Installing package \( package . name , privacy: . auto) " )
48+ AppConstants . shared. logger. debug ( " Installing package \( package . getPackageName ( withPrecision : . precise ) , privacy: . auto) " )
4949
5050 var installationResult : TerminalOutput = . init( standardOutput: " " , standardError: " " )
5151
5252 if package . type == . formula
5353 {
54- AppConstants . shared. logger. info ( " Package \( package . name , privacy: . public) is Formula " )
54+ AppConstants . shared. logger. info ( " Package \( package . getPackageName ( withPrecision : . precise ) , privacy: . public) is Formula " )
5555
5656 let output : String = try await installFormula ( using: brewPackagesTracker) . joined ( separator: " " )
5757
@@ -88,9 +88,9 @@ class InstallationProgressTracker
8888 var hasAlreadyMatchedLineAboutInstallingPackageItself : Bool = false
8989 var installOutput : [ String ] = . init( )
9090
91- AppConstants . shared. logger. info ( " Package \( package . name , privacy: . public) is Formula " )
91+ AppConstants . shared. logger. info ( " Package \( package . getPackageName ( withPrecision : . precise ) , privacy: . public) is Formula " )
9292
93- let ( stream, process) : ( AsyncStream < StreamedTerminalOutput > , Process ) = shell ( AppConstants . shared. brewExecutablePath, [ " install " , package . name ] )
93+ let ( stream, process) : ( AsyncStream < StreamedTerminalOutput > , Process ) = shell ( AppConstants . shared. brewExecutablePath, [ " install " , package . getPackageName ( withPrecision : . precise ) ] )
9494 installationProcess = process
9595 for await output in stream
9696 {
@@ -110,7 +110,7 @@ class InstallationProgressTracker
110110 if outputLine. contains ( " Fetching dependencies " )
111111 {
112112 // First, we have to get a list of all the dependencies
113- var matchedDependencies : String = try outputLine. regexMatch ( " (?<= \( package . name ) : ).*?(.*) " )
113+ var matchedDependencies : String = try outputLine. regexMatch ( " (?<= \( package . getPackageName ( withPrecision : . precise ) ) : ).*?(.*) " )
114114 matchedDependencies = matchedDependencies. replacingOccurrences ( of: " and " , with: " , " ) // The last dependency is different, because it's preceded by "and" instead of "," so let's replace that "and" with "," so we can split it nicely
115115
116116 AppConstants . shared. logger. debug ( " Matched Dependencies: \( matchedDependencies, privacy: . auto) " )
@@ -126,7 +126,7 @@ class InstallationProgressTracker
126126 packageBeingInstalled. packageInstallationProgress = 1
127127 }
128128
129- else if outputLine. contains ( " Installing dependencies " ) || outputLine. contains ( " Installing \( package . name ) dependency " )
129+ else if outputLine. contains ( " Installing dependencies " ) || outputLine. contains ( " Installing \( package . getPackageName ( withPrecision : . precise ) ) dependency " )
130130 {
131131 AppConstants . shared. logger. info ( " Will install dependencies! " )
132132 packageBeingInstalled. installationStage = . installingDependencies
@@ -151,7 +151,7 @@ class InstallationProgressTracker
151151 packageBeingInstalled. packageInstallationProgress = packageBeingInstalled. packageInstallationProgress + Double( Double ( 10 ) / ( Double ( 3 ) * ( Double ( numberOfPackageDependencies) * Double( 5 ) ) ) )
152152 }
153153
154- else if outputLine. contains ( " Fetching \( package . name ) " ) || outputLine. contains ( " Installing \( package . name ) " )
154+ else if outputLine. contains ( " Fetching \( package . getPackageName ( withPrecision : . precise ) ) " ) || outputLine. contains ( " Installing \( package . getPackageName ( withPrecision : . precise ) ) " )
155155 {
156156 if hasAlreadyMatchedLineAboutInstallingPackageItself
157157 { /// Only the second line about the package being installed is valid
@@ -205,9 +205,9 @@ class InstallationProgressTracker
205205 let package : BrewPackage = packageBeingInstalled. package
206206
207207 AppConstants . shared. logger. info ( " Package is Cask " )
208- AppConstants . shared. logger. debug ( " Installing package \( package . name , privacy: . public) " )
208+ AppConstants . shared. logger. debug ( " Installing package \( package . getPackageName ( withPrecision : . precise ) , privacy: . public) " )
209209
210- let ( stream, process) : ( AsyncStream < StreamedTerminalOutput > , Process ) = shell ( AppConstants . shared. brewExecutablePath, [ " install " , package . name ] )
210+ let ( stream, process) : ( AsyncStream < StreamedTerminalOutput > , Process ) = shell ( AppConstants . shared. brewExecutablePath, [ " install " , package . getPackageName ( withPrecision : . precise ) ] )
211211 installationProcess = process
212212 for await output in stream
213213 {
@@ -255,7 +255,7 @@ class InstallationProgressTracker
255255 }
256256 else if outputLine. contains ( " Purging files " )
257257 {
258- AppConstants . shared. logger. info ( " Purging old version of cask \( package . name ) " )
258+ AppConstants . shared. logger. info ( " Purging old version of cask \( package . getPackageName ( withPrecision : . precise ) ) " )
259259
260260 packageBeingInstalled. installationStage = . installingCask
261261
0 commit comments