Skip to content

Commit

Permalink
Merge pull request #358 from paketo-buildpacks/fix_alibaba_updates
Browse files Browse the repository at this point in the history
Adjusts regular expressions to handle changes made to the Java 11 releases of Alibaba Dragonwell
  • Loading branch information
Daniel Mikusa authored Aug 30, 2021
2 parents 63b4ec2 + c452d37 commit 12518b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actions/alibaba-dragonwell-dependency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {

candidates := make(map[string]Holder)
var candidateVersions []string
re := regexp.MustCompile(`dragonwell-(.+)_.+-ga`)
re := regexp.MustCompile(`(dragonwell-)?(\d+\.\d+\.\d+\.?\d*).*-(ga|GA)`)
opt := &github.ListOptions{PerPage: 100}
for {
rel, rsp, err := gh.Repositories.ListReleases(context.Background(), "alibaba", r, opt)
Expand All @@ -77,7 +77,7 @@ func main() {
for _, a := range r.Assets {
if g.MatchString(*a.Name) {
if g := re.FindStringSubmatch(*r.TagName); g != nil {
ver := g[1]
ver := g[2]
candidateVersions = append(candidateVersions, ver)
candidates[ver] = Holder{Assets: r.Assets, URI: *a.BrowserDownloadURL}
break
Expand Down Expand Up @@ -158,7 +158,7 @@ func GetVersion(assets []*github.ReleaseAsset) string {

var v string

re = regexp.MustCompile(`JAVA_VERSION="([\d]+)\.([\d]+)\.([\d]+)[_]?([\d]+)?"`)
re = regexp.MustCompile(`JAVA_VERSION="([\d]+)\.([\d]+)\.([\d]+)[\._]?([\d]+)?"`)
if g := re.FindStringSubmatch(string(b)); g != nil {
if g[2] == "8" {
v = fmt.Sprintf("8.0.%s", g[4])
Expand Down

0 comments on commit 12518b9

Please sign in to comment.