fix runtime versions
v2 cover fix runtime versions
Add a bbclass to modify autogen.sh, then we can inherit it in the recipes to remove the unknown suffix in runtime versions.
Yi Zhao (9):
drop-unknown-suffix.bbclass: add class for removing unknown suffix in
version
gnupg: drop -unknown suffix from version number libgpg-error:: drop -unknown suffix from version number
pinentry: drop -unknown suffix from version number
libgcrypt: drop -unknown suffix from version number
libassuan: drop -unknown suffix from version number
libksba: drop -unknown suffix from version number
procps: fix runtime version when using git shallow tarball
psmisc: fix runtime version when using git shallow tarball
.../drop-unknown-suffix.bbclass | 29 +++++++++++++++++ meta/recipes-extended/procps/procps_4.0.5.bb | 2 +- meta/recipes-extended/psmisc/psmisc_23.7.bb | 2 +- ...h-fix-find-version-for-beta-checking.patch | 31 ------------------- meta/recipes-support/gnupg/gnupg_2.5.5.bb | 3 +- .../libassuan/libassuan_3.0.2.bb | 2 +- .../libgcrypt/libgcrypt_1.11.1.bb | 2 +- .../libgpg-error/libgpg-error_1.55.bb | 2 +- meta/recipes-support/libksba/libksba_1.6.7.bb | 2 +- .../pinentry/pinentry_1.3.1.bb | 2 +- 10 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 meta/classes-recipe/drop-unknown-suffix.bbclass delete mode 100644 meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
Signature · 1 line
2.34.1
PATCH v2 1/9 drop-unknown-suffix.bbclass: add class for removing unknown suffix in version
This class is used to remove unknown suffix in runtime version for gnupg and its related packages. In these packages, if autogen.sh is run outside of a git repo, the find-version function always assumes that the package is a beta version and adds the suffix '-unknown' to the version number.
This calss modifies autogen.sh to:
1. Replace beta=yes with beta=no
2. Replace tmp="-unknown" with tmp=""
--- .../drop-unknown-suffix.bbclass | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 meta/classes-recipe/drop-unknown-suffix.bbclass
meta/classes-recipe/drop-unknown-suffix.bbclass new file +29 -0
@@ -0,0 +1,29 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +# +# This class is used to remove unknown suffix in runtime version +# for gnupg and its related packages. +# +# In these packages, if autogen.sh is run outside of a git repo, +# the find-version function always assumes that the package is a +# beta version and adds the suffix '-unknown' to the version number. +# +# This calss modifies autogen.sh to: +# 1. Replace beta=yes with beta=no +# 2. Replace tmp="-unknown" with tmp="" +# + +do_configure:prepend() { + if [ -f ${S}/autogen.sh ]; then + sed -i \ + -e 's/^\([[:space:]]*\)beta=yes$/\1beta=no/' \ + -e 's/^\([[:space:]]*\)tmp="-unknown"$/\1tmp=""/' \ + ${S}/autogen.sh + else + bbwarn "autogen.sh not found in ${S}." + fi +}
Signature · 1 line
2.34.1
Re: [OE-core] [PATCH 1/9] drop-unknown-suffix.bbclass: add class for removing unknown suffix in version
Quoted 46 lines · Yi Zhao via lists.openembedded.org
This class is used to remove unknown suffix in runtime version for gnupg
and its related packages. In these packages, ifautogen.shis run outside of a git repo, the find-version function always assumes that the
package is a beta version and adds the suffix '-unknown' to the version
number.This calss modifies
autogen.shto:
1. Replace beta=yes with beta=no
2. Replace tmp="-unknown" with tmp=""Signed-off-by Yi Zhao <[email protected]>---
.../drop-unknown-suffix.bbclass | 29
+++++++++++++++++++1 file changed, 29 insertions(+)create mode 100644 meta/classes-recipe/drop-unknown-suffix.bbclass
meta/classes-recipe/drop-unknown-suffix.bbclass new file +19
-0@@ -0,0 +1,29 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +# +# This class is used to remove unknown suffix in runtime version +# for gnupg and its related packages. +# +# In these packages, if autogen.sh is run outside of a git repo, +# the find-version function always assumes that the package is a +# beta version and adds the suffix '-unknown' to the version number. +# +# This calss modifies autogen.sh to: +# 1. Replace beta=yes with beta=no +# 2. Replace tmp="-unknown" with tmp="" +# +
meta/classes-recipe/drop-unknown-suffix.bbclass line 29
Quoted 10 lines
meta/classes-recipe/drop-unknown-suffix.bbclass new file +10
-0+do_configure:prepend() { + if [ -f ${S}/autogen.sh ]; then + sed -i \ + -e 's/^\([[:space:]]*\)beta=yes$/\1beta=no/' \ + -e 's/^\([[:space:]]*\)tmp="-unknown"$/\1tmp=""/' \ + ${S}/autogen.sh + else + bbwarn "autogen.sh not found in ${S}." + fi +}
This is the right direction, my only question was on naming and location. A bbclass is meant to be fairly generic and I'd suggest this just be a .inc file, probably as something like meta/recipes- support/gnupg/drop-unknown-suffix.inc which the other recipes could then require?
Cheers,
Richard
PATCH v2 2/9 gnupg: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version. Also remove 0004-autogen.sh-fix-find-version-for-beta-checking.patch as it is no longer needed.
Befor the fix:
$ gpg --version gpg (GnuPG) 2.5.5-unknown
After the fix:
$ gpg --version gpg (GnuPG) 2.5.5
--- ...h-fix-find-version-for-beta-checking.patch | 31 ------------------- meta/recipes-support/gnupg/gnupg_2.5.5.bb | 3 +- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch deleted +0 -31
@@ -1,31 +0,0 @@ -From 4d8cc1982273d571b4e80fe981878d0fa5884236 Mon Sep 17 00:00:00 2001 -From: Wenzong Fan <[email protected]> -Date: Wed, 16 Aug 2017 11:23:22 +0800 -Subject: [PATCH] autogen.sh: fix find-version for beta checking - -find-version always assumes that gnupg is beta if autogen.sh is run -out of git-repo. This doesn't work for users whom just take release -tarball and re-run autoconf in their local build dir. - -Upstream-Status: Pending - -Signed-off-by: Wenzong Fan <[email protected]> - -Rebase to 2.1.23 -Signed-off-by: Hongxu Jia <[email protected]> ---- - autogen.sh | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/autogen.sh b/autogen.sh -index 9f91297..116fb7f 100755 ---- a/autogen.sh -+++ b/autogen.sh -@@ -270,7 +270,6 @@ if [ "$myhost" = "find-version" ]; then - rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) - else - ingit=no -- beta=yes - tmp="-unknown" - cid="0000000" - rev="0000000"
meta/recipes-support/gnupg/gnupg_2.5.5.bb +1 -2
@@ -11,12 +11,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=189af8afca6d6075ba6c9e0aa8077626 \ DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt" -inherit autotools gettext texinfo pkgconfig upstream-version-is-even +inherit autotools gettext texinfo pkgconfig upstream-version-is-even drop-unknown-suffix UPSTREAM_CHECK_URI = "https://gnupg.org/ftp/gcrypt/gnupg/" SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0002-use-pkgconfig-instead-of-npth-config.patch \ - file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \ file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \ " SRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
Signature · 1 line
2.34.1
PATCH v2 3/9 libgpg-error:: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version.
Befor the fix:
$ gpg-error --version gpg-error (libgpg-error) 1.55-unknown
After the fix:
$ gpg-error --version gpg-error (libgpg-error) 1.55
--- meta/recipes-support/libgpg-error/libgpg-error_1.55.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgpg-error/libgpg-error_1.55.bb +1 -1
@@ -23,7 +23,7 @@ SRC_URI[sha256sum] = "95b178148863f07d45df0cea67e880a79b9ef71f5d230baddc00711285 BINCONFIG = "${bindir}/gpg-error-config" -inherit autotools binconfig-disabled pkgconfig gettext multilib_header multilib_script ptest +inherit autotools binconfig-disabled pkgconfig gettext multilib_header multilib_script ptest drop-unknown-suffix RDEPENDS:${PN}-ptest:append = " make bash"
Signature · 1 line
2.34.1
PATCH v2 4/9 pinentry: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version.
Befor the fix:
$ pinentry --version pinentry-curses (pinentry) 1.3.1-unknown
After the fix:
$ pinentry --version pinentry-curses (pinentry) 1.3.1
--- meta/recipes-support/pinentry/pinentry_1.3.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/pinentry/pinentry_1.3.1.bb +1 -1
@@ -18,7 +18,7 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ SRC_URI[sha256sum] = "bc72ee27c7239007ab1896c3c2fae53b076e2c9bd2483dc2769a16902bce8c04" -inherit autotools pkgconfig +inherit autotools pkgconfig drop-unknown-suffix PACKAGECONFIG ??= "ncurses"
Signature · 1 line
2.34.1
PATCH v2 5/9 libgcrypt: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version.
Befor the fix:
$ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0-unknown
After the fix:
$ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0
--- meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb +1 -1
@@ -30,7 +30,7 @@ SRC_URI[sha256sum] = "24e91c9123a46c54e8371f3a3a2502f1198f2893fbfbf59af95bc1c214 BINCONFIG = "${bindir}/libgcrypt-config" -inherit autotools texinfo binconfig-disabled pkgconfig ptest +inherit autotools texinfo binconfig-disabled pkgconfig ptest drop-unknown-suffix EXTRA_OECONF = "--disable-asm" EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'"
Signature · 1 line
2.34.1
PATCH v2 6/9 libassuan: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version.
Befor the fix:
$ cat /usr/lib/pkgconfig/libassuan.pc
[snip]
Name: libassuan
Description: IPC library for the GnuPG components
Requires.private: gpg-error
Version: 3.0.2-unknown
Cflags: -I${includedir}
[snip]After the fix:
$ cat /usr/lib/pkgconfig/libassuan.pc
[snip]
Name: libassuan
Description: IPC library for the GnuPG components
Requires.private: gpg-error
Version: 3.0.2
Cflags: -I${includedir}
[snip]--- meta/recipes-support/libassuan/libassuan_3.0.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libassuan/libassuan_3.0.2.bb +1 -1
@@ -24,7 +24,7 @@ SRC_URI[sha256sum] = "d2931cdad266e633510f9970e1a2f346055e351bb19f9b78912475b807 BINCONFIG = "${bindir}/libassuan-config" -inherit autotools texinfo binconfig-disabled pkgconfig multilib_header +inherit autotools texinfo binconfig-disabled pkgconfig multilib_header drop-unknown-suffix do_configure:prepend () { # Else these could be used in preference to those in aclocal-copy
Signature · 1 line
2.34.1
PATCH v2 7/9 libksba: drop -unknown suffix from version number
In reply to Yi ZhaoInherit drop-unknown-suffix to remove unknown suffix in runtime version.
Befor the fix:
$ cat /usr/lib/pkgconfig/ksba.pc
[snip]
Name: ksba
Description: X.509 and CMS support library
Requires: gpg-error
Version: 1.6.7-unknown
Cflags: -I${includedir}
[snip]After the fix:
$ cat /usr/lib/pkgconfig/ksba.pc
[snip]
Name: ksba
Description: X.509 and CMS support library
Requires: gpg-error
Version: 1.6.7
Cflags: -I${includedir}
[snip]--- meta/recipes-support/libksba/libksba_1.6.7.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/libksba/libksba_1.6.7.bb +1 -1
@@ -18,7 +18,7 @@ DEPENDS = "libgpg-error" BINCONFIG = "${bindir}/ksba-config" -inherit autotools binconfig-disabled pkgconfig texinfo +inherit autotools binconfig-disabled pkgconfig texinfo drop-unknown-suffix UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
Signature · 1 line
2.34.1
PATCH v2 8/9 procps: fix runtime version when using git shallow tarball
In reply to Yi ZhaoAdd tag to SRC_URI to fix runtime version when using git shallow tarball.
Before the fix:
root@intel-x86-64:~# ps -V ps from procps-ng UNKNOWN root@intel-x86-64:~# sysctl -V sysctl from procps-ng UNKNOWN
After the fix:
root@intel-x86-64:~# ps -V ps from procps-ng 4.0.5 root@intel-x86-64:~# sysctl -V sysctl from procps-ng 4.0.5
--- meta/recipes-extended/procps/procps_4.0.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/procps/procps_4.0.5.bb +1 -1
@@ -12,7 +12,7 @@ DEPENDS = "ncurses" inherit autotools gettext pkgconfig update-alternatives -SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ +SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master;tag=v${PV} \ file://sysctl.conf \ " SRCREV = "f46b2f7929cdfe2913ed0a7f585b09d6adbf994e"
Signature · 1 line
2.34.1
PATCH v2 9/9 psmisc: fix runtime version when using git shallow tarball
In reply to Yi ZhaoAdd tag to SRC_URI to fix runtime version when using git shallow tarball.
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
--- meta/recipes-extended/psmisc/psmisc_23.7.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/psmisc/psmisc_23.7.bb +1 -1
@@ -12,7 +12,7 @@ DEPENDS = "ncurses virtual/libintl" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" -SRC_URI = "git://gitlab.com/psmisc/psmisc.git;protocol=https;branch=master \ +SRC_URI = "git://gitlab.com/psmisc/psmisc.git;protocol=https;branch=master;tag=v${PV} \ " SRCREV = "9091d6dbcce3d8fb87adf9249a2eb346d25a562c"
Signature · 1 line
2.34.1