public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH multilib.eclass] Distinguish between unset and empty variables when restoring.
@ 2013-04-20  5:12 Michał Górny
  2013-04-20  6:10 ` [gentoo-dev] " Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Górny @ 2013-04-20  5:12 UTC (permalink / raw
  To: gentoo-dev; +Cc: hasufell, amd64, toolchain, Michał Górny

Currently, the multilib_toolchain_setup function does not distinguish
between unset and empty variables. Therefore, variables which were unset
before calling it are restored as empty and exported. This breaks some
packages, e.g. libdbusmenu.

This patch 'disables' saving variables which were unset, therefore
making the saved variants unset. Then, restoring exports only those
variables which were set in the saved variants and unsets remaining
ones.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=461682
---
 gx86/eclass/multilib.eclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gx86/eclass/multilib.eclass b/gx86/eclass/multilib.eclass
index 13583d0..dd78d38 100644
--- a/gx86/eclass/multilib.eclass
+++ b/gx86/eclass/multilib.eclass
@@ -397,7 +397,8 @@ multilib_toolchain_setup() {
 	if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then
 		for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
 			vv="__abi_saved_${v}"
-			export ${v}="${!vv}"
+			unset ${v}
+			[[ ${!vv+1} ]] && export ${v}="${!vv}"
 			unset ${vv}
 		done
 		unset __DEFAULT_ABI_SAVED
@@ -408,7 +409,9 @@ multilib_toolchain_setup() {
 	if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
 		# Back that multilib-ass up so we can restore it later
 		for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
-			export __abi_saved_${v}="${!v}"
+			vv=__abi_saved_${v}
+			unset ${vv}
+			[[ ${!v+1} ]] && export ${vv}="${!v}"
 		done
 		export __DEFAULT_ABI_SAVED="true"
 
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-22  1:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-20  5:12 [gentoo-dev] [PATCH multilib.eclass] Distinguish between unset and empty variables when restoring Michał Górny
2013-04-20  6:10 ` [gentoo-dev] " Mike Frysinger
2013-04-20 15:42   ` Michał Górny
2013-04-22  1:18     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox