Add meson.build to version_stamp.pl

Started by Peter Eisentrautover 3 years ago4 messages
#1Peter Eisentraut
peter.eisentraut@enterprisedb.com
1 attachment(s)

Thinking ahead a bit, we need to add meson.build to version_stamp.pl.

Maybe someone can think of a better sed expression, but this one seems
good enough to me for now.

Attachments:

0001-Add-meson.build-to-version_stamp.pl.patchtext/plain; charset=UTF-8; name=0001-Add-meson.build-to-version_stamp.pl.patchDownload
From aae1dc51287655af3f847c3b7d07050f6e8651ec Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 5 Oct 2022 10:32:34 +0200
Subject: [PATCH] Add meson.build to version_stamp.pl

---
 src/tools/version_stamp.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl
index 9d4f44d4a95b..a8b696b28eba 100755
--- a/src/tools/version_stamp.pl
+++ b/src/tools/version_stamp.pl
@@ -95,6 +95,9 @@
 sed_file("configure.ac",
 	"-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'"
 );
+sed_file("meson.build",
+	qq{-e "1,20s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
+);
 
 print "Stamped these files with version number $fullversion:\n$fixedfiles";
 print "Don't forget to run autoconf $aconfver before committing.\n";
-- 
2.37.3

In reply to: Peter Eisentraut (#1)
Re: Add meson.build to version_stamp.pl

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:

Thinking ahead a bit, we need to add meson.build to version_stamp.pl.

Maybe someone can think of a better sed expression, but this one seems
good enough to me for now.

[…]

+sed_file("meson.build",
+	qq{-e "1,20s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
+);

I think it would be better to not rely on the line numbers, but instead
limit it to the project() stanza, something like this:

sed_file("meson.build",
qq{-e "/^project(/,/^)/ s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
);

- ilmari

#3Andres Freund
andres@anarazel.de
In reply to: Dagfinn Ilmari Mannsåker (#2)
Re: Add meson.build to version_stamp.pl

Hi,

On 2022-10-05 11:36:36 +0100, Dagfinn Ilmari Mannsåker wrote:

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:

Thinking ahead a bit, we need to add meson.build to version_stamp.pl.

Good idea. I was wondering for a moment whether we should put the version
into some file instead, and reference that from meson.build - but the
convenient way to do that is only in 0.56, which we currently don't want to
require... We could work around it, but it doesn't seem necessary for now.

Maybe someone can think of a better sed expression, but this one seems
good enough to me for now.

[…]

+sed_file("meson.build",
+	qq{-e "1,20s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
+);

I think it would be better to not rely on the line numbers, but instead
limit it to the project() stanza, something like this:

sed_file("meson.build",
qq{-e "/^project(/,/^)/ s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
);

Yea, that looks nicer.

Greetings,

Andres Freund

#4Michael Paquier
michael@paquier.xyz
In reply to: Andres Freund (#3)
Re: Add meson.build to version_stamp.pl

On Wed, Oct 05, 2022 at 11:20:50AM -0700, Andres Freund wrote:

On 2022-10-05 11:36:36 +0100, Dagfinn Ilmari Mannsåker wrote:

sed_file("meson.build",
qq{-e "/^project(/,/^)/ s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
);

Yea, that looks nicer.

Oh. That's nice..
--
Michael