MCPcopy Index your code
hub / github.com/celer-pkg/celer / InstallFromDevCache

Method InstallFromDevCache

configs/port_install.go:462–509  ·  view source on GitHub ↗
(options InstallOptions)

Source from the content-addressed store, hash-verified

460}
461
462func (p *Port) InstallFromDevCache(options InstallOptions) (bool, error) {
463 // Install from local dev cache only work for hostDev or devDep.
464 if !p.HostDep && !p.DevDep {
465 return false, nil
466 }
467
468 // Rebuild with force.
469 if !options.Force {
470 return false, nil
471 }
472
473 // Disable devCache in build_config.
474 // For some library like icu, cross-compile it should base on its native build cache dir.
475 if p.MatchedConfig.DisableDevCache {
476 return false, nil
477 }
478
479 // Check if devCacheConfig has been configured.
480 devCacheConfig := p.ctx.DevCacheConfig()
481 if devCacheConfig == nil {
482 return false, nil
483 }
484
485 installed, err := p.doInstallFromDevCache(options)
486 if err != nil {
487 // Repo not exist is not error.
488 if errors.Is(err, errors.ErrRepoNotExit) {
489 return false, nil
490 }
491 return false, err
492 }
493
494 if installed {
495 // Install dependencies also.
496 if err := p.installDependencies(options); err != nil {
497 return false, err
498 }
499
500 if err := p.doInstallFromPackage(p.InstalledDir); err != nil {
501 return false, err
502 }
503
504 fromDir := devCacheConfig.GetDir()
505 return true, p.writeTraceFile(fmt.Sprintf("dev-cache: %q", fromDir))
506 }
507
508 return false, nil
509}
510
511func (p *Port) InstallFromSource(options InstallOptions) error {
512 // Reset at top-level entry.

Callers 1

InstallMethod · 0.95

Calls 8

doInstallFromDevCacheMethod · 0.95
installDependenciesMethod · 0.95
doInstallFromPackageMethod · 0.95
writeTraceFileMethod · 0.95
IsFunction · 0.92
SprintfMethod · 0.80
DevCacheConfigMethod · 0.65
GetDirMethod · 0.65

Tested by

no test coverage detected