From fd92287376f1d958cfc6d65927945494c6449802 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Wed, 7 Oct 2026 16:34:58 -0500 Subject: [PATCH] Reject `--pgtle-version` values that aren't an exact pg_tle range name `make pgtle PGXNTOOL_PGTLE_VERSION=...` and `pgtle.sh --pgtle-version` used the value verbatim as the output directory name, so a plain pg_tle version such as `1.5.0` silently produced a bogus `pg_tle/1.5.0/` directory with an "unknown" capability. `pgtle.sh` now accepts only the names in `PGTLE_VERSIONS` (`1.0.0-1.4.0`, `1.4.0-1.5.0`, `1.5.0+`) and otherwise errors, listing the valid ranges. When the value parses as a plain version, the error also names its range via the `--get-dir` logic (e.g. "did you mean 1.5.0+?"). `--get-dir` itself is unchanged. README.asc/README.html: the two sentences saying other values are passed through unvalidated now describe the error instead. Related changes in pgxntool-test: - New `test/standard/pgtle-version-validate.bats` invokes `pgtle.sh` directly: accepted ranges, plain versions with the hint, garbage values Co-Authored-By: Claude Opus 5.5 --- HISTORY.asc | 7 +++++++ README.asc | 4 ++-- README.html | 6 +++--- pgtle.sh | 30 +++++++++++++++++++++++++++--- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/HISTORY.asc b/HISTORY.asc index 2e99b76..f4e108f 100644 --- a/HISTORY.asc +++ b/HISTORY.asc @@ -88,6 +88,13 @@ Install files now always run in byte-value (ASCII) filename order, regardless of filesystem or locale. If one install file depends on another, encode that in the filenames (e.g. a numeric prefix); see README. +== `PGXNTOOL_PGTLE_VERSION` must be an exact pg_tle range name +`make pgtle PGXNTOOL_PGTLE_VERSION=...` (and `pgtle.sh --pgtle-version`) now +errors unless the value is exactly `1.0.0-1.4.0`, `1.4.0-1.5.0` or `1.5.0+`. +A plain pg_tle version such as `1.5.0` used to be accepted silently, +generating a bogus `pg_tle/1.5.0/` directory; the error now names the range +it belongs to (`did you mean 1.5.0+?`). + Issues fixed in this release: #20, #21, #55, #87, #90, #97, #108, #111, #115, #119 2.3.0 diff --git a/README.asc b/README.asc index 11df229..0dd1aa5 100644 --- a/README.asc +++ b/README.asc @@ -373,7 +373,7 @@ Set `PGXNTOOL_PGTLE_VERSION` on the command line to a range name (`1.0.0-1.4.0`, make pgtle PGXNTOOL_PGTLE_VERSION=1.5.0+ ---- -The value must be one of those range names exactly; it is not mapped from a plain pg_tle version. Any other value (e.g. `1.5.0`) is not validated and produces a bogus `pg_tle/1.5.0/` directory. +The value must be one of those range names exactly; it is not mapped from a plain pg_tle version. Any other value is rejected with an error listing the valid ranges; for a plain pg_tle version (e.g. `1.5.0`), the error also names the range it falls in. === check-pgtle Checks if pg_tle is installed and reports the version. This target: @@ -766,7 +766,7 @@ Default: auto-detected, the first of `asciidoctor` or `asciidoc` found on `PATH` === PGXNTOOL_PGTLE_VERSION -Default: unset (generates every known pg_tle version range). Set on the command line to a range name (`1.0.0-1.4.0`, `1.4.0-1.5.0` or `1.5.0+`, exactly) to limit `make pgtle` to that one range; any other value is passed through unvalidated and generates a bogus `pg_tle//` directory. Not named `PGTLE_VERSION`: make auto-imports same-named environment variables, and that name collided silently with CI jobs that set a `PGTLE_VERSION` env var for an unrelated purpose (which pg_tle to test against). See <<_pgtle>>. +Default: unset (generates every known pg_tle version range). Set on the command line to a range name (`1.0.0-1.4.0`, `1.4.0-1.5.0` or `1.5.0+`, exactly) to limit `make pgtle` to that one range; any other value is rejected with an error. Not named `PGTLE_VERSION`: make auto-imports same-named environment variables, and that name collided silently with CI jobs that set a `PGTLE_VERSION` env var for an unrelated purpose (which pg_tle to test against). See <<_pgtle>>. === PGXNTOOL_PGTLE_TARGET_VERSION diff --git a/README.html b/README.html index e12c0de..14c32d1 100644 --- a/README.html +++ b/README.html @@ -1361,7 +1361,7 @@

-

The value must be one of those range names exactly; it is not mapped from a plain pg_tle version. Any other value (e.g. 1.5.0) is not validated and produces a bogus pg_tle/1.5.0/ directory.

+

The value must be one of those range names exactly; it is not mapped from a plain pg_tle version. Any other value is rejected with an error listing the valid ranges; for a plain pg_tle version (e.g. 1.5.0), the error also names the range it falls in.

@@ -2088,7 +2088,7 @@

8.4. PGXNTOOL_PGTLE_VERSION

-

Default: unset (generates every known pg_tle version range). Set on the command line to a range name (1.0.0-1.4.0, 1.4.0-1.5.0 or 1.5.0+, exactly) to limit make pgtle to that one range; any other value is passed through unvalidated and generates a bogus pg_tle/<value>/ directory. Not named PGTLE_VERSION: make auto-imports same-named environment variables, and that name collided silently with CI jobs that set a PGTLE_VERSION env var for an unrelated purpose (which pg_tle to test against). See pgtle.

+

Default: unset (generates every known pg_tle version range). Set on the command line to a range name (1.0.0-1.4.0, 1.4.0-1.5.0 or 1.5.0+, exactly) to limit make pgtle to that one range; any other value is rejected with an error. Not named PGTLE_VERSION: make auto-imports same-named environment variables, and that name collided silently with CI jobs that set a PGTLE_VERSION env var for an unrelated purpose (which pg_tle to test against). See pgtle.

@@ -2217,7 +2217,7 @@