Skip to content

Makefile: generic SED marker processing via awk; sql/.gitignore: wildcard for versioned files#14

Merged
jnasbyupgrade merged 3 commits intomasterfrom
sql-gitignore-and-sqlin-build
Apr 20, 2026
Merged

Makefile: generic SED marker processing via awk; sql/.gitignore: wildcard for versioned files#14
jnasbyupgrade merged 3 commits intomasterfrom
sql-gitignore-and-sqlin-build

Conversation

@jnasbyupgrade
Copy link
Copy Markdown
Contributor

Summary

  • sql/.gitignore: Replace hard-coded per-version entries with cat_tools--*.sql wildcard + !-exceptions for historical files that have no .sql.in source (0.1.* and 0.2.0--0.2.1). New versioned files no longer need manual .gitignore updates.
  • Makefile: Replace per-version ifeq/safesed blocks in the build recipe with a reusable define _apply_version_seds that:
    • Handles PG 9.3 and 9.5 via the existing safesed hack (temporary, to be dropped with 9.x support)
    • Handles PG 10+ generically via a single POSIX awk one-liner — no per-version maintenance needed
  • Makefile: Add rules to build EXTENSION_VERSION_FILES via a .sql.in intermediate, overriding control.mk's direct-copy rule so version-conditional SED markers (-- SED: REQUIRES N! / -- SED: PRIOR TO N!) are applied to the current version's install script.

Test plan

  • make succeeds on PG 9.3, 9.5, and a PG 10+ version
  • Generated sql/cat_tools--<version>.sql has correct SED substitutions applied
  • CI passes across full PG version matrix

🤖 Generated with Claude Code

jnasbyupgrade and others added 3 commits April 17, 2026 16:52
… version; sql/.gitignore: use wildcard

- Replace per-version ifeq/sed blocks in the .sql build recipe with a
  define (_apply_version_seds) that applies 9.x hacks via safesed variables
  and handles PG 10+ generically via a single POSIX awk invocation.
- Add rules to build EXTENSION_VERSION_FILES via a .sql.in intermediate,
  overriding control.mk's direct-copy rule so SED markers are applied.
- Replace hard-coded versioned file list in sql/.gitignore with a wildcard
  (cat_tools--*.sql) plus !-exceptions for historical files with no .sql.in.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Write to $@.tmp first, then atomically mv to $@, so a failed pipeline
never leaves a partial file that appears complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rsion>.sql

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jnasbyupgrade jnasbyupgrade merged commit 429ea5b into master Apr 20, 2026
26 checks passed
@jnasbyupgrade jnasbyupgrade deleted the sql-gitignore-and-sqlin-build branch April 20, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant