diff --git a/main.go b/main.go index ed1d0d32379a9b563d8659fcc21edde83b370863..946e3bdb6ecb7a0a4998ed23f430a1cec2c08977 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( // Some options here. Would be improved in beta release. const DEDUCT_PKGNAME_FROM_VARNAME = true const USE_PROJECT_NETVER_INSTEAD_OF_HINTPATH_NETVER = false -const OPENXT_VERSION = "1.1b" +const OPENXT_VERSION = "1.1b-2" func print_help_and_exit() { println("Usage: openxt <subcommand> [options...]") diff --git a/packageManager.go b/packageManager.go index 6fcdbb7b2ce728f7d36b3ca45a5f824f3c67ccac..de69231256f44f6de58056a6cded8ba963862f5d 100644 --- a/packageManager.go +++ b/packageManager.go @@ -28,16 +28,16 @@ func ScanForDependencies(scanPath string) (allDeps []dependencyItem) { // Download `allDeps` to localRepoPath, with nuget.config from nugetConfigPath. // However, nugetConfigPath is not supported now. We use default nuget.config now. (Usually in ~/.nuget/) func SyncPackages(nugetConfigPath, localRepoPath string, allDeps []dependencyItem) { - log.Println("WARNING: We do not support custom nugetConfigPath yet. Please make sure your default nuget.config works. (usually ~/.nuget/NuGet/NuGet.Config)") - // Prepare nuget local repo depsToSync := depsDeduplicate(allDeps) var wg sync.WaitGroup + concurrencyLimitChan := make(chan int, 64) for index_, dep_ := range depsToSync { wg.Add(1) + concurrencyLimitChan <- 1 // will block if there's already 64 goroutine running go func(index int, dep dependencyItem) { - defer wg.Done() + defer func() {<-concurrencyLimitChan ; wg.Done()}() log.Printf("[%v/%v] Begin downloading: %v:%v as var %v", index, len(depsToSync), dep.pkgName, dep.targetNetVer, dep.envName) log.Println("nuget-download-package", dep.pkgName, dep.targetNetVer, localRepoPath, nugetConfigPath)