MCPcopy Create free account
hub / github.com/celer-pkg/celer / isGroupPackage

Method isGroupPackage

buildtools/setup_msys2.go:265–284  ·  view source on GitHub ↗
(target string)

Source from the content-addressed store, hash-verified

263}
264
265func (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
286func (m msys2) removeFile(file string) error {
287 pattern := filepath.ToSlash(filepath.Join(m.rootDir, "/*/usr/bin/"+file))

Callers 2

checkIfInstalledMethod · 0.95
markAsInstalledMethod · 0.95

Calls 3

NewExecutorFunction · 0.92
MSYS2EnvMethod · 0.80
ExecuteOutputMethod · 0.80

Tested by

no test coverage detected