]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: restore tools/meson-vcs-tag.sh
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Sep 2023 14:46:04 +0000 (16:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Sep 2023 12:37:09 +0000 (14:37 +0200)
commit1a71ac07adafebe7e0074f92d049f72968ca2d47
treeb1a895b1d732a80c957c3de5fbb2f613e64b1e04
parentba4d7e80290303074faa1851c2833f6a58ddcc72
meson: restore tools/meson-vcs-tag.sh

This conceptually reverts e95acdfe1d3a790e18617bb992a712b34f41800d,
but the actual contents of the script are taken from the command invocation
in meson with all the updates that happened in the meantime.

One small change is that I replaced () by {}: this avoids one subprocess spawn.
People were worried about the cost of vcs_tag(), and this microoptimization may
help a bit. I measured the speed on machine, and noop rebuilds are still about
100–120 ms.

The logic is entirely moved to the script. This makes the meson config simpler
and also makes it easier to use it externally.

The script is needed for in-place rpm builds, see README.build-in-place.md [1],
where it is invoked from the spec file to determine the project version.

[1] https://src.fedoraproject.org/rpms/systemd/blob/rawhide/f/README.build-in-place.md
meson.build
tools/meson-vcs-tag.sh [new file with mode: 0755]