(target string)
| 263 | } |
| 264 | |
| 265 | func (m *msys2) isGroupPackage(target string) (bool, error) { |
| 266 | // Query all available packages and cache them. |
| 267 | if m.availablePackages == nil { |
| 268 | executor := cmd.NewExecutor("[pacman list all groups]", "pacman -Sg") |
| 269 | executor.MSYS2Env(true) |
| 270 | output, err := executor.ExecuteOutput() |
| 271 | if err != nil { |
| 272 | return false, fmt.Errorf("query available groups: %s", err) |
| 273 | } |
| 274 | |
| 275 | m.availablePackages = strings.Split(output, "\n") |
| 276 | } |
| 277 | |
| 278 | // Check if the target is one of the available groups. |
| 279 | if slices.Contains(m.availablePackages, target) { |
| 280 | return true, nil |
| 281 | } |
| 282 | |
| 283 | return false, nil |
| 284 | } |
| 285 | |
| 286 | func (m msys2) removeFile(file string) error { |
| 287 | pattern := filepath.ToSlash(filepath.Join(m.rootDir, "/*/usr/bin/"+file)) |
no test coverage detected