From e0aeedcc3f1542c2a5ef2aafbda1b82c4f4d3fcb Mon Sep 17 00:00:00 2001 From: "AO3\\andriws.luna" Date: Thu, 30 May 2024 12:49:15 -0300 Subject: [PATCH 1/7] Added Browsing path property in boss .json. This is similar to mainsrc, but add browsing to delphi registry --- models/package.go | 1 + utils/librarypath/global_util_win.go | 42 ++++++++++++++++++++++++ utils/librarypath/librarypath.go | 49 ++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/models/package.go b/models/package.go index c2da1fa..8bf9e49 100644 --- a/models/package.go +++ b/models/package.go @@ -17,6 +17,7 @@ type Package struct { Version string `json:"version"` Homepage string `json:"homepage"` MainSrc string `json:"mainsrc"` + BrowsingPath string `json:"browsingpath"` Projects []string `json:"projects"` Scripts interface{} `json:"scripts,omitempty"` Dependencies interface{} `json:"dependencies"` diff --git a/utils/librarypath/global_util_win.go b/utils/librarypath/global_util_win.go index e2a5462..4cf2476 100644 --- a/utils/librarypath/global_util_win.go +++ b/utils/librarypath/global_util_win.go @@ -16,6 +16,7 @@ import ( ) const SearchPathRegistry = "Search Path" +const BrowsingPathRegistry = "Browsing Path" func updateGlobalLibraryPath() { ideVersion := bossRegistry.GetCurrentDelphiVersion() @@ -57,3 +58,44 @@ func updateGlobalLibraryPath() { } } + +func updateGlobalBrowsingPath() { + ideVersion := bossRegistry.GetCurrentDelphiVersion() + if ideVersion == "" { + msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) + } + library, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library`, registry.ALL_ACCESS) + + if err != nil { + msg.Err(`Registry path` + consts.RegistryBasePath + ideVersion + `\Library not exists`) + return + } + + libraryInfo, err := library.Stat() + if err != nil { + msg.Err(err.Error()) + return + } + platforms, err := library.ReadSubKeyNames(int(libraryInfo.SubKeyCount)) + if err != nil { + msg.Err("No platform found for delphi " + ideVersion) + return + } + + for _, platform := range platforms { + delphiPlatform, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library\`+platform, registry.ALL_ACCESS) + utils.HandleError(err) + paths, _, err := delphiPlatform.GetStringValue(BrowsingPathRegistry) + if err != nil { + msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) + continue + } + + splitPaths := strings.Split(paths, ";") + newSplitPaths := GetNewBrowsingPaths(splitPaths, false, env.GetCurrentDir()) + newPaths := strings.Join(newSplitPaths, ";") + err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) + utils.HandleError(err) + } + +} diff --git a/utils/librarypath/librarypath.go b/utils/librarypath/librarypath.go index dbe61fe..67b7af3 100644 --- a/utils/librarypath/librarypath.go +++ b/utils/librarypath/librarypath.go @@ -18,6 +18,7 @@ func UpdateLibraryPath(pkg *models.Package) { updateGlobalLibraryPath() } else { updateDprojLibraryPath(pkg) + updateGlobalBrowsingPath() } } @@ -40,6 +41,27 @@ func cleanPath(paths []string, fullPath bool) []string { return processedPaths } +func GetNewBrowsingPaths(paths []string, fullPath bool, rootPath string) []string { + paths = cleanPath(paths, fullPath) + var path = env.GetModulesDir() + + matches, _ := ioutil.ReadDir(path) + + for _, value := range matches { + + var packagePath = filepath.Join(path, value.Name(), consts.FilePackage) + if _, err := os.Stat(packagePath); !os.IsNotExist(err) { + + other, _ := models.LoadPackageOther(packagePath) + if other.BrowsingPath != "" { + paths = getNewBrowsingPathsFromDir(filepath.Join(path, value.Name(), other.BrowsingPath), paths, fullPath, rootPath) + } + + } + } + return paths +} + func GetNewPaths(paths []string, fullPath bool, rootPath string) []string { paths = cleanPath(paths, fullPath) var path = env.GetModulesDir() @@ -99,6 +121,33 @@ func cleanEmpty(paths []string) []string { return paths } +func getNewBrowsingPathsFromDir(path string, paths []string, fullPath bool, rootPath string) []string { + _, e := os.Stat(path) + if os.IsNotExist(e) { + return paths + } + + _ = filepath.Walk(path, func(path string, info os.FileInfo, err error) error { + matched, _ := regexp.MatchString(consts.RegexArtifacts, info.Name()) + if matched { + dir, _ := filepath.Split(path) + if !fullPath { + dir, _ = filepath.Rel(rootPath, dir) + } + if !utils.Contains(paths, dir) { + paths = append(paths, dir) + } + // add ..\ prefixed path -> @MeroFuruya fix #146 + //prefixedPath := "..\\" + dir + //if !utils.Contains(paths, prefixedPath) { + // paths = append(paths, prefixedPath) + //} + } + return nil + }) + return cleanEmpty(paths) +} + func getNewPathsFromDir(path string, paths []string, fullPath bool, rootPath string) []string { _, e := os.Stat(path) if os.IsNotExist(e) { From ac7fe167c80fd17ebb7f658a36a250a6ef959a11 Mon Sep 17 00:00:00 2001 From: "AO3\\andriws.luna" Date: Thu, 30 May 2024 16:21:14 -0300 Subject: [PATCH 2/7] Adding browsing path by project relative root folder --- utils/librarypath/dproj_itil.go | 56 ++++++++++++++++++++++++++++ utils/librarypath/global_util_win.go | 42 --------------------- utils/librarypath/librarypath.go | 2 +- 3 files changed, 57 insertions(+), 43 deletions(-) diff --git a/utils/librarypath/dproj_itil.go b/utils/librarypath/dproj_itil.go index 2d662e3..f395b89 100644 --- a/utils/librarypath/dproj_itil.go +++ b/utils/librarypath/dproj_itil.go @@ -11,12 +11,16 @@ import ( "github.com/beevik/etree" "github.com/hashload/boss/consts" + bossRegistry "github.com/hashload/boss/core/registry" "github.com/hashload/boss/env" "github.com/hashload/boss/models" "github.com/hashload/boss/msg" "github.com/hashload/boss/utils" + "golang.org/x/sys/windows/registry" ) +const BrowsingPathRegistry = "Browsing Path" + func updateDprojLibraryPath(pkg *models.Package) { var isLazarus = isLazarus() var projectNames = GetProjectNames(pkg) @@ -88,6 +92,58 @@ func createTagOtherUnitFiles(node *etree.Element) *etree.Element { return child } +func updateGlobalBrowsingByProject(dprojName string) { + ideVersion := bossRegistry.GetCurrentDelphiVersion() + if ideVersion == "" { + msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) + } + library, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library`, registry.ALL_ACCESS) + + if err != nil { + msg.Err(`Registry path` + consts.RegistryBasePath + ideVersion + `\Library not exists`) + return + } + + libraryInfo, err := library.Stat() + if err != nil { + msg.Err(err.Error()) + return + } + platforms, err := library.ReadSubKeyNames(int(libraryInfo.SubKeyCount)) + if err != nil { + msg.Err("No platform found for delphi " + ideVersion) + return + } + + for _, platform := range platforms { + delphiPlatform, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library\`+platform, registry.ALL_ACCESS) + utils.HandleError(err) + paths, _, err := delphiPlatform.GetStringValue(BrowsingPathRegistry) + if err != nil { + msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) + continue + } + + splitPaths := strings.Split(paths, ";") + rootPath := filepath.Join(env.GetCurrentDir(), path.Dir(dprojName)) + newSplitPaths := GetNewBrowsingPaths(splitPaths, false, rootPath) + newPaths := strings.Join(newSplitPaths, ";") + err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) + utils.HandleError(err) + } +} + +func updateGlobalBrowsingPath(pkg *models.Package) { + var isLazarus = isLazarus() + var projectNames = GetProjectNames(pkg) + for _, projectName := range projectNames { + if !isLazarus { + updateGlobalBrowsingByProject(projectName) + } + } + +} + func updateLibraryPathProject(dprojName string) { doc := etree.NewDocument() info, err := os.Stat(dprojName) diff --git a/utils/librarypath/global_util_win.go b/utils/librarypath/global_util_win.go index 4cf2476..e2a5462 100644 --- a/utils/librarypath/global_util_win.go +++ b/utils/librarypath/global_util_win.go @@ -16,7 +16,6 @@ import ( ) const SearchPathRegistry = "Search Path" -const BrowsingPathRegistry = "Browsing Path" func updateGlobalLibraryPath() { ideVersion := bossRegistry.GetCurrentDelphiVersion() @@ -58,44 +57,3 @@ func updateGlobalLibraryPath() { } } - -func updateGlobalBrowsingPath() { - ideVersion := bossRegistry.GetCurrentDelphiVersion() - if ideVersion == "" { - msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) - } - library, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library`, registry.ALL_ACCESS) - - if err != nil { - msg.Err(`Registry path` + consts.RegistryBasePath + ideVersion + `\Library not exists`) - return - } - - libraryInfo, err := library.Stat() - if err != nil { - msg.Err(err.Error()) - return - } - platforms, err := library.ReadSubKeyNames(int(libraryInfo.SubKeyCount)) - if err != nil { - msg.Err("No platform found for delphi " + ideVersion) - return - } - - for _, platform := range platforms { - delphiPlatform, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library\`+platform, registry.ALL_ACCESS) - utils.HandleError(err) - paths, _, err := delphiPlatform.GetStringValue(BrowsingPathRegistry) - if err != nil { - msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) - continue - } - - splitPaths := strings.Split(paths, ";") - newSplitPaths := GetNewBrowsingPaths(splitPaths, false, env.GetCurrentDir()) - newPaths := strings.Join(newSplitPaths, ";") - err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) - utils.HandleError(err) - } - -} diff --git a/utils/librarypath/librarypath.go b/utils/librarypath/librarypath.go index 67b7af3..e8a6c61 100644 --- a/utils/librarypath/librarypath.go +++ b/utils/librarypath/librarypath.go @@ -18,7 +18,7 @@ func UpdateLibraryPath(pkg *models.Package) { updateGlobalLibraryPath() } else { updateDprojLibraryPath(pkg) - updateGlobalBrowsingPath() + updateGlobalBrowsingPath(pkg) } } From a87169701f5eefe1a18304a8321bc00c7dee9403 Mon Sep 17 00:00:00 2001 From: "AO3\\andriws.luna" Date: Thu, 30 May 2024 18:32:56 -0300 Subject: [PATCH 3/7] set browsignpaths folder to readonly --- utils/librarypath/dproj_itil.go | 8 ++++---- utils/librarypath/librarypath.go | 27 +++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/utils/librarypath/dproj_itil.go b/utils/librarypath/dproj_itil.go index f395b89..088bc99 100644 --- a/utils/librarypath/dproj_itil.go +++ b/utils/librarypath/dproj_itil.go @@ -92,7 +92,7 @@ func createTagOtherUnitFiles(node *etree.Element) *etree.Element { return child } -func updateGlobalBrowsingByProject(dprojName string) { +func updateGlobalBrowsingByProject(dprojName string, setReadOnly bool) { ideVersion := bossRegistry.GetCurrentDelphiVersion() if ideVersion == "" { msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) @@ -126,7 +126,7 @@ func updateGlobalBrowsingByProject(dprojName string) { splitPaths := strings.Split(paths, ";") rootPath := filepath.Join(env.GetCurrentDir(), path.Dir(dprojName)) - newSplitPaths := GetNewBrowsingPaths(splitPaths, false, rootPath) + newSplitPaths := GetNewBrowsingPaths(splitPaths, false, rootPath, setReadOnly) newPaths := strings.Join(newSplitPaths, ";") err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) utils.HandleError(err) @@ -136,9 +136,9 @@ func updateGlobalBrowsingByProject(dprojName string) { func updateGlobalBrowsingPath(pkg *models.Package) { var isLazarus = isLazarus() var projectNames = GetProjectNames(pkg) - for _, projectName := range projectNames { + for i, projectName := range projectNames { if !isLazarus { - updateGlobalBrowsingByProject(projectName) + updateGlobalBrowsingByProject(projectName, i == 0) } } diff --git a/utils/librarypath/librarypath.go b/utils/librarypath/librarypath.go index e8a6c61..73ba1ba 100644 --- a/utils/librarypath/librarypath.go +++ b/utils/librarypath/librarypath.go @@ -1,8 +1,10 @@ package librarypath import ( + "fmt" "io/ioutil" "os" + "os/exec" "path/filepath" "regexp" "strings" @@ -10,6 +12,7 @@ import ( "github.com/hashload/boss/consts" "github.com/hashload/boss/env" "github.com/hashload/boss/models" + "github.com/hashload/boss/msg" "github.com/hashload/boss/utils" ) @@ -41,7 +44,7 @@ func cleanPath(paths []string, fullPath bool) []string { return processedPaths } -func GetNewBrowsingPaths(paths []string, fullPath bool, rootPath string) []string { +func GetNewBrowsingPaths(paths []string, fullPath bool, rootPath string, setReadOnly bool) []string { paths = cleanPath(paths, fullPath) var path = env.GetModulesDir() @@ -54,7 +57,26 @@ func GetNewBrowsingPaths(paths []string, fullPath bool, rootPath string) []strin other, _ := models.LoadPackageOther(packagePath) if other.BrowsingPath != "" { - paths = getNewBrowsingPathsFromDir(filepath.Join(path, value.Name(), other.BrowsingPath), paths, fullPath, rootPath) + dir := filepath.Join(path, value.Name(), other.BrowsingPath) + paths = getNewBrowsingPathsFromDir(dir, paths, fullPath, rootPath) + + if setReadOnly { + readonlybat := filepath.Join(dir, "readonly.bat") + readFileStr := fmt.Sprintf(`attrib +r "%s" /s /d`, filepath.Join(dir, "*")) + err = ioutil.WriteFile(readonlybat, []byte(readFileStr), os.ModePerm) + if err != nil { + msg.Warn(" - error on create build file") + } + + cmd := exec.Command(readonlybat) + + if _, err := cmd.Output(); err != nil { + msg.Err(" - Failed to set readonly property to folder", dir, " - ", err) + } else { + os.Remove(readonlybat) + } + } + } } @@ -131,6 +153,7 @@ func getNewBrowsingPathsFromDir(path string, paths []string, fullPath bool, root matched, _ := regexp.MatchString(consts.RegexArtifacts, info.Name()) if matched { dir, _ := filepath.Split(path) + if !fullPath { dir, _ = filepath.Rel(rootPath, dir) } From 6667c71647f8656a4875108e6d9fc05d59fb6c79 Mon Sep 17 00:00:00 2001 From: "AO3\\andriws.luna" Date: Fri, 31 May 2024 10:26:08 -0300 Subject: [PATCH 4/7] Isolate windows code --- utils/librarypath/dproj_itil.go | 45 ---------------------------- utils/librarypath/global_util_win.go | 44 +++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/utils/librarypath/dproj_itil.go b/utils/librarypath/dproj_itil.go index 088bc99..5f4860a 100644 --- a/utils/librarypath/dproj_itil.go +++ b/utils/librarypath/dproj_itil.go @@ -11,16 +11,12 @@ import ( "github.com/beevik/etree" "github.com/hashload/boss/consts" - bossRegistry "github.com/hashload/boss/core/registry" "github.com/hashload/boss/env" "github.com/hashload/boss/models" "github.com/hashload/boss/msg" "github.com/hashload/boss/utils" - "golang.org/x/sys/windows/registry" ) -const BrowsingPathRegistry = "Browsing Path" - func updateDprojLibraryPath(pkg *models.Package) { var isLazarus = isLazarus() var projectNames = GetProjectNames(pkg) @@ -92,47 +88,6 @@ func createTagOtherUnitFiles(node *etree.Element) *etree.Element { return child } -func updateGlobalBrowsingByProject(dprojName string, setReadOnly bool) { - ideVersion := bossRegistry.GetCurrentDelphiVersion() - if ideVersion == "" { - msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) - } - library, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library`, registry.ALL_ACCESS) - - if err != nil { - msg.Err(`Registry path` + consts.RegistryBasePath + ideVersion + `\Library not exists`) - return - } - - libraryInfo, err := library.Stat() - if err != nil { - msg.Err(err.Error()) - return - } - platforms, err := library.ReadSubKeyNames(int(libraryInfo.SubKeyCount)) - if err != nil { - msg.Err("No platform found for delphi " + ideVersion) - return - } - - for _, platform := range platforms { - delphiPlatform, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library\`+platform, registry.ALL_ACCESS) - utils.HandleError(err) - paths, _, err := delphiPlatform.GetStringValue(BrowsingPathRegistry) - if err != nil { - msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) - continue - } - - splitPaths := strings.Split(paths, ";") - rootPath := filepath.Join(env.GetCurrentDir(), path.Dir(dprojName)) - newSplitPaths := GetNewBrowsingPaths(splitPaths, false, rootPath, setReadOnly) - newPaths := strings.Join(newSplitPaths, ";") - err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) - utils.HandleError(err) - } -} - func updateGlobalBrowsingPath(pkg *models.Package) { var isLazarus = isLazarus() var projectNames = GetProjectNames(pkg) diff --git a/utils/librarypath/global_util_win.go b/utils/librarypath/global_util_win.go index e2a5462..93662e2 100644 --- a/utils/librarypath/global_util_win.go +++ b/utils/librarypath/global_util_win.go @@ -4,6 +4,8 @@ package librarypath import ( + "path" + "path/filepath" "strings" "github.com/hashload/boss/consts" @@ -16,6 +18,7 @@ import ( ) const SearchPathRegistry = "Search Path" +const BrowsingPathRegistry = "Browsing Path" func updateGlobalLibraryPath() { ideVersion := bossRegistry.GetCurrentDelphiVersion() @@ -57,3 +60,44 @@ func updateGlobalLibraryPath() { } } + +func updateGlobalBrowsingByProject(dprojName string, setReadOnly bool) { + ideVersion := bossRegistry.GetCurrentDelphiVersion() + if ideVersion == "" { + msg.Err("Version not found for path %s", env.GlobalConfiguration.DelphiPath) + } + library, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library`, registry.ALL_ACCESS) + + if err != nil { + msg.Err(`Registry path` + consts.RegistryBasePath + ideVersion + `\Library not exists`) + return + } + + libraryInfo, err := library.Stat() + if err != nil { + msg.Err(err.Error()) + return + } + platforms, err := library.ReadSubKeyNames(int(libraryInfo.SubKeyCount)) + if err != nil { + msg.Err("No platform found for delphi " + ideVersion) + return + } + + for _, platform := range platforms { + delphiPlatform, err := registry.OpenKey(registry.CURRENT_USER, consts.RegistryBasePath+ideVersion+`\Library\`+platform, registry.ALL_ACCESS) + utils.HandleError(err) + paths, _, err := delphiPlatform.GetStringValue(BrowsingPathRegistry) + if err != nil { + msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) + continue + } + + splitPaths := strings.Split(paths, ";") + rootPath := filepath.Join(env.GetCurrentDir(), path.Dir(dprojName)) + newSplitPaths := GetNewBrowsingPaths(splitPaths, false, rootPath, setReadOnly) + newPaths := strings.Join(newSplitPaths, ";") + err = delphiPlatform.SetStringValue(BrowsingPathRegistry, newPaths) + utils.HandleError(err) + } +} From 3f06db9d61c8cd57799e31ec7fd5e41291a11d71 Mon Sep 17 00:00:00 2001 From: "AO3\\andriws.luna" Date: Fri, 31 May 2024 10:30:11 -0300 Subject: [PATCH 5/7] unix funcion added --- utils/librarypath/global_util_unix.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/librarypath/global_util_unix.go b/utils/librarypath/global_util_unix.go index c1ba94d..ea5b923 100644 --- a/utils/librarypath/global_util_unix.go +++ b/utils/librarypath/global_util_unix.go @@ -10,3 +10,7 @@ import ( func updateGlobalLibraryPath() { msg.Warn("updateGlobalLibraryPath not implemented on this platform") } + +func updateGlobalBrowsingByProject(dprojName string, setReadOnly bool) { + msg.Warn("updateGlobalBrowsingByProject not implemented on this platform") +} From 80f6fb936eaaa639ef6bebfef54ab9c942e19248 Mon Sep 17 00:00:00 2001 From: "andriws.luna" Date: Tue, 9 Jul 2024 09:33:19 -0300 Subject: [PATCH 6/7] install fetch repo only when necessary --- core/installer/core.go | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/core/installer/core.go b/core/installer/core.go index ed3395a..7733b7d 100644 --- a/core/installer/core.go +++ b/core/installer/core.go @@ -4,6 +4,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -43,7 +44,7 @@ func EnsureDependencies(rootLock models.PackageLock, pkg *models.Package, locked } deps := pkg.GetParsedDependencies() - makeCache(deps) + //makeCache(deps) ensureModules(rootLock, pkg, deps, lockedVersion) @@ -52,13 +53,6 @@ func EnsureDependencies(rootLock models.PackageLock, pkg *models.Package, locked return deps } -func makeCache(deps []models.Dependency) { - msg.Info("Building cache files...") - for _, dep := range deps { - GetDependency(dep) - } -} - func processOthers(rootLock models.PackageLock, lockedVersion bool) []models.Dependency { infos, e := ioutil.ReadDir(env.GetModulesDir()) var lenProcessedInitial = len(processed) @@ -106,8 +100,38 @@ func ensureModules(rootLock models.PackageLock, pkg *models.Package, deps []mode msg.Info("Installing modules") for _, dep := range deps { msg.Info("Processing dependency %s", dep.GetName()) + + installed, exists := rootLock.Installed[strings.ToLower(dep.GetURL())] + + if lockedVersion && exists { + depv := strings.Replace(strings.Replace(dep.GetVersion(), "^", "", -1), "~", "", -1) + requiredVersion, err := semver.NewVersion(depv) + + if err != nil { + msg.Warn(" Error '%s' on get required version. Updating...", err) + + } else { + installedVersion, err := semver.NewVersion(installed.Version) + + if err != nil { + msg.Warn(" Error '%s' on get installed version. Updating...", err) + } else { + if !installedVersion.LessThan(requiredVersion) { + msg.Info("Dependency %s already installed", dep.GetName()) + continue + } else { + msg.Info("Dependency %s needs to update", dep.GetName()) + } + } + } + + } + //git fetch only when necessary + GetDependency(dep) + repository := gitWrapper.GetRepository(dep) - hasMatch, bestMatch := getVersion(rootLock, dep, repository, lockedVersion) + hasMatch, bestMatch := getVersion(rootLock, dep, repository, false) + var referenceName plumbing.ReferenceName worktree, _ := repository.Worktree() From 03c72e0f973164a4a273ac8811364eeb19fb0bfb Mon Sep 17 00:00:00 2001 From: "andriws.luna" Date: Fri, 9 Aug 2024 18:14:39 -0300 Subject: [PATCH 7/7] dcc_serachpath montage fix --- core/compiler/executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/compiler/executor.go b/core/compiler/executor.go index 4c8d54a..89959e9 100644 --- a/core/compiler/executor.go +++ b/core/compiler/executor.go @@ -48,7 +48,7 @@ func buildSearchPath(dep *models.Dependency) string { if pac, e := models.LoadPackageOther(filepath.Join(env.GetModulesDir(), dep.GetName(), consts.FilePackage)); e == nil { searchPath += ";" + filepath.Join(env.GetModulesDir(), dep.GetName(), pac.MainSrc) for _, lib := range pac.GetParsedDependencies() { - searchPath += buildSearchPath(&lib) + searchPath += ";" + buildSearchPath(&lib) } } }