diff mbox series

[2/2] psmisc: fix runtime version when using git shallow tarball

Message ID 20250516093127.506158-2-yi.zhao@windriver.com
State New
Headers show
Series [1/2] procps: fix runtime version when using git shallow tarball | expand

Commit Message

Yi Zhao May 16, 2025, 9:31 a.m. UTC
The runtime version of psmisc is generated by 'git describe' command in
misc/git-version-gen. But when using git shallow tarball,
git-version-gen can not get the correct version due to missing git
tag/commit messages. This actually breaks reproducibility, since the
generated binaries should be consistent regardless of the source code
packaging format.

Add a .tarball-version file in source directory. Then get-version-gen
can determine the version through this file instead of 'git describe'
command.

Before the fix:
root@intel-x86-64:~# pslog -V
pslog (PSmisc) UNKNOWN

After the fix:
root@intel-x86-64:~# pslog  -V
pslog (PSmisc) 23.7

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 meta/recipes-extended/psmisc/psmisc_23.7.bb | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/recipes-extended/psmisc/psmisc_23.7.bb b/meta/recipes-extended/psmisc/psmisc_23.7.bb
index 4128ca0533..d6bb7ef81b 100644
--- a/meta/recipes-extended/psmisc/psmisc_23.7.bb
+++ b/meta/recipes-extended/psmisc/psmisc_23.7.bb
@@ -24,6 +24,7 @@  inherit autotools gettext
 # doesn't believe po/ is a gettext directory and won't generate po/Makefile.
 do_configure:prepend() {
     ( cd ${S} && po/update-potfiles )
+    [ ! -e ${S}/.tarball-version ] && echo ${PV} > ${S}/.tarball-version
 }