diff --git a/core/installers.go b/core/installers.go index e19b5caf..7c320aad 100644 --- a/core/installers.go +++ b/core/installers.go @@ -132,7 +132,7 @@ func getIde(productCode string) *ReleaseDownloadInfo { return nil } - release := SelectLatestRelease(product, dist) + release := SelectLatestCompatibleRelease(product, dist) if release == nil { ErrorMessage("Error while obtaining the release type: ", dist) return nil diff --git a/core/installers_test.go b/core/installers_test.go index 0655b03c..b86d94ed 100644 --- a/core/installers_test.go +++ b/core/installers_test.go @@ -37,7 +37,7 @@ func TestGetIde(t *testing.T) { } func TestDownloadAndInstallIDE(t *testing.T) { - ides := []string{QDPY, "QDNET"} // QDPY requires exe on Windows, QDNET - does not + ides := []string{"QDNET-EAP"} // QDPY requires exe on Windows, QDNET - does not for _, ide := range ides { DownloadAndInstallIDE(ide, t) } diff --git a/core/releases.go b/core/releases.go index 82bdfb9c..d4ba229a 100644 --- a/core/releases.go +++ b/core/releases.go @@ -98,13 +98,13 @@ func GetProductByCode(code string) (*Product, error) { return nil, nil } -func SelectLatestRelease(product *Product, reqType string) *ReleaseInfo { +func SelectLatestCompatibleRelease(product *Product, reqType string) *ReleaseInfo { var latestRelease *ReleaseInfo latestDate := "" for i := 0; i < len(product.Releases); i++ { release := &product.Releases[i] - if release.Type == reqType && (latestRelease == nil || release.Date > latestDate) { + if *release.MajorVersion == MajorVersion && release.Type == reqType && (latestRelease == nil || release.Date > latestDate) { latestRelease = release latestDate = release.Date } diff --git a/core/releases_test.go b/core/releases_test.go index c8e8daf4..9ce63df9 100644 --- a/core/releases_test.go +++ b/core/releases_test.go @@ -29,12 +29,12 @@ func TestGetProductByCode(t *testing.T) { t.Fail() } - eap := SelectLatestRelease(product, "eap") + eap := SelectLatestCompatibleRelease(product, "eap") if eap == nil { t.Fail() } - release := SelectLatestRelease(product, "release") + release := SelectLatestCompatibleRelease(product, "release") if release == nil { t.Fail() }