Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ include pgxntool/base.mk
- `PGXNVERSION` - version number
- `EXTENSIONS` - list of extensions provided
- `EXTENSION_*_VERSION` - per-extension versions
- `EXTENSION_VERSION_FILES` - auto-generated versioned SQL files
- `EXTENSION__CURRENT_VERSION__FILES` - auto-generated versioned SQL files
- `base.mk` includes `meta.mk` via `-include`

### The Magic of base.mk
Expand Down
6 changes: 6 additions & 0 deletions HISTORY.asc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
STABLE
------
== Rename `EXTENSION_VERSION_FILES` to `EXTENSION__CURRENT_VERSION__FILES`
The old name implied it listed every version file for an extension; it
actually only ever holds the current/most-recent one per extension. If your
Makefile references `EXTENSION_VERSION_FILES` directly (e.g. to add extra
dependencies to `DATA`), update it to `EXTENSION__CURRENT_VERSION__FILES`.

== Fix `pgtle.sh` rejecting non-numeric version aliases like `stable`
`extract_version_from_filename()` required every version segment to start
with a digit, so extensions using a persistent `stable` pseudo-version
Expand Down
6 changes: 3 additions & 3 deletions base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ control.mk: $(PGXNTOOL_CONTROL_FILES) Makefile $(PGXNTOOL_DIR)/base.mk $(PGXNTOO

-include control.mk

DATA = $(EXTENSION_VERSION_FILES) $(wildcard sql/*--*--*.sql)
DATA = $(EXTENSION__CURRENT_VERSION__FILES) $(wildcard sql/*--*--*.sql)
DOC_DIRS += doc
# NOTE: if this is empty it gets forcibly defined to NUL before including PGXS
DOCS += $(foreach dir,$(DOC_DIRS),$(wildcard $(dir)/*))
Expand Down Expand Up @@ -206,7 +206,7 @@ test = $(shell test $(1) $(2) $(3) && echo yes || echo no)
GE91 = $(call test, $(MAJORVER), -ge, 91)

ifeq ($(GE91),yes)
all: $(EXTENSION_VERSION_FILES)
all: $(EXTENSION__CURRENT_VERSION__FILES)
endif

ifeq ($(call test, $(MAJORVER), -lt, 130), yes)
Expand Down Expand Up @@ -326,7 +326,7 @@ PGXNTOOL_EXTENSIONS = $(basename $(PGXNTOOL_CONTROL_FILES))

# Main target
# Depend on 'all' to ensure versioned SQL files are generated first
# Depend on control.mk (which defines EXTENSION_VERSION_FILES)
# Depend on control.mk (which defines EXTENSION__CURRENT_VERSION__FILES)
# Depend on control files explicitly so changes trigger rebuilds
# Generates all supported pg_tle versions for each extension
.PHONY: pgtle
Expand Down
4 changes: 2 additions & 2 deletions control.mk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# EXTENSION_SQL_FILES += sql/<ext_name>.sql
# EXTENSION_<ext_name>_VERSION := <version>
# EXTENSION_<ext_name>_VERSION_FILE = sql/<ext_name>--<version>.sql
# EXTENSION_VERSION_FILES += $(EXTENSION_<ext_name>_VERSION_FILE)
# EXTENSION__CURRENT_VERSION__FILES += $(EXTENSION_<ext_name>_VERSION_FILE)
# <rules for generating versioned SQL files>
#
# Why control files instead of META.json?
Expand Down Expand Up @@ -80,7 +80,7 @@ for control_file in "$@"; do
echo "EXTENSION_SQL_FILES += sql/${ext}.sql"
echo "EXTENSION_${ext}_VERSION := ${version}"
echo "EXTENSION_${ext}_VERSION_FILE = sql/${ext}--\$(EXTENSION_${ext}_VERSION).sql"
echo "EXTENSION_VERSION_FILES += \$(EXTENSION_${ext}_VERSION_FILE)"
echo "EXTENSION__CURRENT_VERSION__FILES += \$(EXTENSION_${ext}_VERSION_FILE)"
echo "\$(EXTENSION_${ext}_VERSION_FILE): sql/${ext}.sql ${control_file}"
echo " @echo '/* DO NOT EDIT - AUTO-GENERATED FILE */' > \$(EXTENSION_${ext}_VERSION_FILE)"
echo " @cat sql/${ext}.sql >> \$(EXTENSION_${ext}_VERSION_FILE)"
Expand Down
Loading