[OE-core] [PATCH] gnupg: specify explicitly tar path

Wenlin Kang wenlin.kang at windriver.com
Mon Dec 19 07:01:22 UTC 2016


On cross-compile platform, automatic check of ustar is unreliable, so we
specify explicitly tar path after check manually.

Signed-off-by: Wenlin Kang <wenlin.kang at windriver.com>
---
 .../fix-ustar-and-tar-path-check-issue.patch       | 46 ++++++++++++++++++++++
 meta/recipes-support/gnupg/gnupg_1.4.7.bb          |  2 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-support/gnupg/gnupg-1.4.7/fix-ustar-and-tar-path-check-issue.patch

diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/fix-ustar-and-tar-path-check-issue.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/fix-ustar-and-tar-path-check-issue.patch
new file mode 100644
index 0000000..fca8d64
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/fix-ustar-and-tar-path-check-issue.patch
@@ -0,0 +1,46 @@
+Remove automatic detection of tar path and ustar format
+
+Remove automatic detection of tar path and ustar format, because they 
+are unreliable and inappropriate for cross-compile platform.
+
+Upstream status: Inappropriate [cross-compile platform specific]
+
+Signed-off-by: Wenlin Kang <wenlin.kang at windriver.com>
+
+diff -uarN gnupg-1.4.7-org/m4/tar-ustar.m4 gnupg-1.4.7/m4/tar-ustar.m4
+--- gnupg-1.4.7-org/m4/tar-ustar.m4	2016-12-19 11:06:58.621838069 +0800
++++ gnupg-1.4.7/m4/tar-ustar.m4	2016-12-19 11:13:31.721840809 +0800
+@@ -15,22 +15,22 @@
+ 
+   if test x$_do_tar != xno ; then
+ 
+-     if test x$_do_tar = x ; then
+-        AC_PATH_PROG(TAR,"tar")
+-        _mytar=$ac_cv_path_TAR
+-     fi
+-
+      # Check if our tar is ustar format.  If so, it's good.  TODO: Add some
+      # code to check various options, etc, to try and create ustar
+      # format.
+ 
+-     if test x$_mytar != x ; then
+-        AC_MSG_CHECKING([whether $_mytar speaks USTAR])
+-        echo hithere > conftest.txt
+-        $_mytar -cf - conftest.txt | (dd skip=257 bs=1 count=5 2>/dev/null || cat) | grep ustar > /dev/null
+-        _tar_bad=$?
+-        rm conftest.txt
++     if test x$_do_tar != x ; then 
++        AC_SUBST(TAR,$_do_tar)
++        AC_MSG_CHECKING([whether $_do_tar speaks USTAR])
++
++        # Here, we ignore the check code, because it isn't indeed applicable for
++        # cross-compile platform.
++        # Now our tar support ustar, so we say directly yes, but once the tar is changed, 
++        # you should check whether it suppport ustar, and please reference the follow command:
++        # echo hithere > conftest.txt
++        # tar -cf - conftest.txt | (dd skip=257 bs=1 count=5 2>/dev/null || cat) | grep ustar > /dev/null
+ 
++        _tar_bad=0
+ 	if test x$_tar_bad = x0 ; then
+ 	   AC_MSG_RESULT([yes])
+ 	else
diff --git a/meta/recipes-support/gnupg/gnupg_1.4.7.bb b/meta/recipes-support/gnupg/gnupg_1.4.7.bb
index 6ccffd5..6ea6fe3 100644
--- a/meta/recipes-support/gnupg/gnupg_1.4.7.bb
+++ b/meta/recipes-support/gnupg/gnupg_1.4.7.bb
@@ -18,6 +18,7 @@ SRC_URI = "${GNUPG_MIRROR}/gnupg/gnupg-${PV}.tar.bz2 \
            file://CVE-2013-4351.patch \
            file://CVE-2013-4576.patch \
            file://CVE-2013-4242.patch \
+           file://fix-ustar-and-tar-path-check-issue.patch \
 	  "
 
 SRC_URI[md5sum] = "b06a141cca5cd1a55bbdd25ab833303c"
@@ -79,6 +80,7 @@ EXTRA_OECONF = "--disable-ldap \
 		--disable-selinux-support \
                 --with-readline=${STAGING_LIBDIR}/.. \
                 ac_cv_sys_symbol_underscore=no \
+                --with-tar=${base_bindir}/tar \
 		"
 
 # Force gcc's traditional handling of inline to avoid issues with gcc 5
-- 
1.9.1




More information about the Openembedded-core mailing list