[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 1/4] edk2: get version + date from git submodule
From: |
Michael Tokarev |
Subject: |
Re: [PULL 1/4] edk2: get version + date from git submodule |
Date: |
Tue, 9 Apr 2024 21:02:23 +0300 |
User-agent: |
Mozilla Thunderbird |
09.04.2024 19:29, Gerd Hoffmann:
Turned out hard-coding version and date in the Makefile wasn't a bright
idea. Updating it on edk2 updates is easily forgotten. Fetch the info
from git instead. Store in edk2-version, so this can be committed to
the repo and is present in tarballs too.
This too,
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2233
+-include edk2-version
+edk2-version: edk2
+ if test -e edk2/.git; then \
+ echo "EDK2_STABLE = $$(cd edk2; git describe --tags --match
'edk2-stable*')" > $@; \
+ echo "EDK2_DATE = $$(cd edk2; git log -1 --pretty='format:%cd'
--date='format:%m/%d/%Y')" >> $@; \
+ else \
+ touch $@; \
+ fi
edk2-version will become a stray file in the source dir, not cleaned up.
But since this code path is only evaluated once, it is trivial to inline
it, in a way similar to the first version.
BTW, git has -C option instead of using `cd'.
So it goes like this:
EDK2_STABLE = $(shell [ ! -d edk2/.git ] || git -C edk2 describe --tags --match
'edk2-stable*')
ditto for EDK2_DATE.
+efi: edk2-version
$(PYTHON) edk2-build.py --config edk2-build.config \
- --version-override "edk2-stable202302-for-qemu" \
- --release-date "03/01/2023"
+ --version-override "$(EDK2_STABLE)-for-qemu" \
+ --release-date "$(EDK2_DATE)" \
How it will look like if there's no edk2/.git, for example, when run in
extracted release tarball, with empty EDK2_STABLE and EKD2_DATE?
Should these values be a part of release tarball maybe?
Or maybe it's better to base EKD2_{DATE|VERSION} on qemu date/version in
this case?
Thanks,
/mjt
- [PULL 0/4] Edk2 20240409 patches, Gerd Hoffmann, 2024/04/09
- [PULL 1/4] edk2: get version + date from git submodule, Gerd Hoffmann, 2024/04/09
- Re: [PULL 1/4] edk2: get version + date from git submodule,
Michael Tokarev <=
- [PULL 2/4] edk2: commit version info, Gerd Hoffmann, 2024/04/09
- [PULL 3/4] edk2/seabios: use common extra version, Gerd Hoffmann, 2024/04/09
- [PULL 4/4] edk2: rebuild binaries with correct version information, Gerd Hoffmann, 2024/04/09
- Re: [PULL 0/4] Edk2 20240409 patches, Peter Maydell, 2024/04/09