From 28e91f7d8a4f0ae3526bd818f8f64f8c0534ea32 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 12:10:46 +0900 Subject: [PATCH 1/7] Fix the setting incorrect the latest version when PostgreSQL is released new major version. --- README.md | 4 ++-- update-tag-list.rb | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08c19ef..73609b2 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Those images based on [postgres](https://hub.docker.com/_/postgres) and could us | PGroonga | PostgreSQL | Distribution | Tags | Path | | -------- | ---------- | ------------------------- | ------------------------------------------- | ------------------------------------------------- | -| 4.0.4 | 18 | Alpine Linux | 4.0.4-alpine-18, latest-alpine-18 | [alpine/18/Dockerfile][4.0.4-alpine-18] | -| 4.0.4 | 17 | Alpine Linux | 4.0.4-alpine-17, latest-alpine-17, latest | [alpine/17/Dockerfile][4.0.4-alpine-17] | +| 4.0.4 | 18 | Alpine Linux | 4.0.4-alpine-18, latest-alpine-18, latest | [alpine/18/Dockerfile][4.0.4-alpine-18] | +| 4.0.4 | 17 | Alpine Linux | 4.0.4-alpine-17, latest-alpine-17 | [alpine/17/Dockerfile][4.0.4-alpine-17] | | 4.0.4 | 16 | Alpine Linux | 4.0.4-alpine-16, latest-alpine-16 | [alpine/16/Dockerfile][4.0.4-alpine-16] | | 4.0.4 | 15 | Alpine Linux | 4.0.4-alpine-15, latest-alpine-15 | [alpine/15/Dockerfile][4.0.4-alpine-15] | | 4.0.4 | 14 | Alpine Linux | 4.0.4-alpine-14, latest-alpine-14 | [alpine/14/Dockerfile][4.0.4-alpine-14] | diff --git a/update-tag-list.rb b/update-tag-list.rb index 84793ff..0f4bf37 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -37,7 +37,7 @@ def debian_code_name(type_path) tags_width = components[4].size - 2 path_width = components[5].size - 2 - type_paths.each do |type_path| + type_paths.each_with_index do |type_path, i| type = type_path.gsub("/", "-") distribution_id, postgresql_version, = type.split("-") distribution = distribution_labels[distribution_id] @@ -49,6 +49,14 @@ def debian_code_name(type_path) components[3] = " %-#*s " % [distribution_width, distribution] + if i == 0 + # type_paths have already sorted to descending order by the version of PostgreSQL. + # So, when "i == 0" is true, postgresql_version is the latest version. + # + # If the latest vestion get by "components[2].strip", + # this script set incorrect the version as the latest version when PostgreSQL is released new version. + latest_postgresql_version = postgresql_version + end tags = ["#{pgroonga_version}-#{type}", "latest-#{type}"] if tags[0] == "#{pgroonga_version}-alpine-#{latest_postgresql_version}" tags << "latest" From 8d7db41d369e38338a459763d0f8560251841bbd Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 13:53:15 +0900 Subject: [PATCH 2/7] Fix a typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- update-tag-list.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-tag-list.rb b/update-tag-list.rb index 0f4bf37..7ba76c3 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -53,7 +53,7 @@ def debian_code_name(type_path) # type_paths have already sorted to descending order by the version of PostgreSQL. # So, when "i == 0" is true, postgresql_version is the latest version. # - # If the latest vestion get by "components[2].strip", + # If the latest version get by "components[2].strip", # this script set incorrect the version as the latest version when PostgreSQL is released new version. latest_postgresql_version = postgresql_version end From da820ca7a99ac4894b331330dd841772c3b6ad2c Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 13:58:07 +0900 Subject: [PATCH 3/7] Fix English grammar issues in comment --- update-tag-list.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update-tag-list.rb b/update-tag-list.rb index 7ba76c3..409baa0 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -53,8 +53,9 @@ def debian_code_name(type_path) # type_paths have already sorted to descending order by the version of PostgreSQL. # So, when "i == 0" is true, postgresql_version is the latest version. # - # If the latest version get by "components[2].strip", - # this script set incorrect the version as the latest version when PostgreSQL is released new version. + # If the latest version is obtained by "components[2].strip", + # this script incorrectly sets the version as the latest version + # when releases a new version of PostgreSQL. latest_postgresql_version = postgresql_version end tags = ["#{pgroonga_version}-#{type}", "latest-#{type}"] From e8d8b595a56c7684b69ce5b86c6d947abb0ee5e7 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 14:33:10 +0900 Subject: [PATCH 4/7] The latest version obtain from alpine_type_paths --- update-tag-list.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/update-tag-list.rb b/update-tag-list.rb index 409baa0..5ab0aec 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -29,7 +29,8 @@ def debian_code_name(type_path) when / latest / components = line.split("|") - latest_postgresql_version = components[2].strip + latest_postgresql_version = + alpine_type_paths.sort.reverse[0].split("/")[1] pgroonga_version_width = components[1].size - 2 postgresql_version_width = components[2].size - 2 @@ -49,15 +50,6 @@ def debian_code_name(type_path) components[3] = " %-#*s " % [distribution_width, distribution] - if i == 0 - # type_paths have already sorted to descending order by the version of PostgreSQL. - # So, when "i == 0" is true, postgresql_version is the latest version. - # - # If the latest version is obtained by "components[2].strip", - # this script incorrectly sets the version as the latest version - # when releases a new version of PostgreSQL. - latest_postgresql_version = postgresql_version - end tags = ["#{pgroonga_version}-#{type}", "latest-#{type}"] if tags[0] == "#{pgroonga_version}-alpine-#{latest_postgresql_version}" tags << "latest" From c5a266b56d9bc7e1a6b4fee46d72ec696474b485 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 14:42:33 +0900 Subject: [PATCH 5/7] Remove needless modification --- update-tag-list.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-tag-list.rb b/update-tag-list.rb index 5ab0aec..e1ee085 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -38,7 +38,7 @@ def debian_code_name(type_path) tags_width = components[4].size - 2 path_width = components[5].size - 2 - type_paths.each_with_index do |type_path, i| + type_paths.each do |type_path| type = type_path.gsub("/", "-") distribution_id, postgresql_version, = type.split("-") distribution = distribution_labels[distribution_id] From ed19bcf9de6a14b64ea856c0b663666ef98c4b37 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 15:07:19 +0900 Subject: [PATCH 6/7] Reduce the amount of code --- update-tag-list.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/update-tag-list.rb b/update-tag-list.rb index e1ee085..7c72cd9 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -12,11 +12,11 @@ def debian_code_name(type_path) end type_paths = [] -alpine_type_paths = Dir.glob("alpine/*") - ["alpine/build.sh"] -alpine_slim_type_paths = Dir.glob("alpine/*-slim") +alpine_type_paths = (Dir.glob("alpine/*") - ["alpine/build.sh"]).sort.reverse +alpine_slim_type_paths = Dir.glob("alpine/*-slim").sort.reverse alpine_type_paths -= alpine_slim_type_paths -type_paths += alpine_type_paths.sort.reverse -type_paths += alpine_slim_type_paths.sort.reverse +type_paths += alpine_type_paths +type_paths += alpine_slim_type_paths type_paths += Dir.glob("debian/*").sort.reverse readme_md_path = File.join(__dir__, "README.md") @@ -29,8 +29,7 @@ def debian_code_name(type_path) when / latest / components = line.split("|") - latest_postgresql_version = - alpine_type_paths.sort.reverse[0].split("/")[1] + latest_postgresql_version = alpine_type_paths[0].split("/")[1] pgroonga_version_width = components[1].size - 2 postgresql_version_width = components[2].size - 2 From 938c16c1068b298719bf4ae200cd049e480c8159 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Mon, 15 Dec 2025 15:08:34 +0900 Subject: [PATCH 7/7] Add comment to easy to read --- update-tag-list.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/update-tag-list.rb b/update-tag-list.rb index 7c72cd9..effb9b0 100755 --- a/update-tag-list.rb +++ b/update-tag-list.rb @@ -29,6 +29,7 @@ def debian_code_name(type_path) when / latest / components = line.split("|") + # "alpine/18" -> "18" latest_postgresql_version = alpine_type_paths[0].split("/")[1] pgroonga_version_width = components[1].size - 2