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
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Scope of This File

The guidance in this CLAUDE.md applies to pgxntool's own source files and provides
recommended best practices for projects using pgxntool. However, any agent working in
an extension project should always defer to that project's own CLAUDE.md and
instructions over anything stated here.

## Git Commit Guidelines

**IMPORTANT**: When creating commit messages, do not attribute commits to yourself (Claude). Commit messages should reflect the work being done without AI attribution in the message body. The standard Co-Authored-By trailer is acceptable.
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.asc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ the special-case logic in `make results` have been removed. Extensions
that used `.source` files should convert them to regular `test/sql/*.sql`
and `test/expected/*.out` files using relative paths.

== Fix bash 3.2 compatibility and shebang portability
`${#ARRAY[@]:-0}` is a syntax error in bash 3.2; replaced with `${#ARRAY[@]}`.
Shell scripts now use `#!/usr/bin/env bash`.

1.1.2
-----
== Fix double --dbname bug that defeated unique test database names
Expand Down
5 changes: 3 additions & 2 deletions base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ dist: html
# But don't add it as an install or test dependency unless we do have asciidoc
ifneq (,$(strip $(ASCIIDOC)))

# Need to do this so install & co will pick up ALL targets. Unfortunately this can result in some duplication.
DOCS += $(ASCIIDOC_HTML)
# Add HTML to DOCS for install, deduplicating against any HTML already picked
# up by the wildcard (e.g. pre-built HTML committed to the repo).
DOCS := $(sort $(filter-out $(ASCIIDOC_HTML),$(DOCS)) $(ASCIIDOC_HTML))

# Also need to add html as a dep to all (which will get picked up by install & installcheck
all: html
Expand Down
2 changes: 1 addition & 1 deletion build_meta.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Build META.json from META.in.json template
#
Expand Down
2 changes: 1 addition & 1 deletion lib.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# lib.sh - Common utility functions for pgxntool scripts
#
# This file is meant to be sourced by other scripts, not executed directly.
Expand Down
16 changes: 8 additions & 8 deletions pgtle.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# pgtle.sh - Generate pg_tle registration SQL for PostgreSQL extensions
#
Expand Down Expand Up @@ -564,8 +564,8 @@ discover_sql_files() {
echo " - $f" >&2
done

debug 30 "discover_sql_files: Checking UPGRADE_FILES array, count=${#UPGRADE_FILES[@]:-0}"
if [ ${#UPGRADE_FILES[@]:-0} -gt 0 ]; then
debug 30 "discover_sql_files: Checking UPGRADE_FILES array, count=${#UPGRADE_FILES[@]}"
if [ ${#UPGRADE_FILES[@]} -gt 0 ]; then
echo " Found ${#UPGRADE_FILES[@]} upgrade script(s):" >&2
debug 30 "discover_sql_files: Iterating over ${#UPGRADE_FILES[@]} upgrade files"
for f in "${UPGRADE_FILES[@]}"; do
Expand Down Expand Up @@ -633,8 +633,8 @@ build_requires_array() {
generate_header() {
local pgtle_version="$1"
local output_file="$2"
local version_count=${#VERSION_FILES[@]:-0}
local upgrade_count=${#UPGRADE_FILES[@]:-0}
local version_count=${#VERSION_FILES[@]}
local upgrade_count=${#UPGRADE_FILES[@]}

# Determine version compatibility message
local compat_msg
Expand Down Expand Up @@ -760,8 +760,8 @@ generate_pgtle_sql() {
# Ensure arrays are initialized (defensive programming)
# Arrays should already be initialized at top level, but ensure they exist
debug 30 "generate_pgtle_sql: Checking array initialization"
debug 30 "generate_pgtle_sql: VERSION_FILES is ${VERSION_FILES+set}, count=${#VERSION_FILES[@]:-0}"
debug 30 "generate_pgtle_sql: UPGRADE_FILES is ${UPGRADE_FILES+set}, count=${#UPGRADE_FILES[@]:-0}"
debug 30 "generate_pgtle_sql: VERSION_FILES is ${VERSION_FILES+set}, count=${#VERSION_FILES[@]}"
debug 30 "generate_pgtle_sql: UPGRADE_FILES is ${UPGRADE_FILES+set}, count=${#UPGRADE_FILES[@]}"

if [ -z "${VERSION_FILES+set}" ]; then
echo "WARNING: VERSION_FILES not set, initializing" >&2
Expand Down Expand Up @@ -819,7 +819,7 @@ EOF
fi

# Install all upgrade paths
local upgrade_count=${#UPGRADE_FILES[@]:-0}
local upgrade_count=${#UPGRADE_FILES[@]}
debug 30 "generate_pgtle_sql: upgrade_count=$upgrade_count"
if [ "$upgrade_count" -gt 0 ]; then
debug 30 "generate_pgtle_sql: Processing $upgrade_count upgrade path(s)"
Expand Down