From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A7B801381F3 for ; Sat, 20 Apr 2013 05:11:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A86CBE090E; Sat, 20 Apr 2013 05:11:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D50E0E0903 for ; Sat, 20 Apr 2013 05:11:16 +0000 (UTC) Received: from pomiocik.lan (178-37-186-237.adsl.inetia.pl [178.37.186.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 5F21933DEAE; Sat, 20 Apr 2013 05:11:14 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: hasufell@gentoo.org, amd64@gentoo.org, toolchain@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH multilib.eclass] Distinguish between unset and empty variables when restoring. Date: Sat, 20 Apr 2013 07:12:20 +0200 Message-Id: <1366434740-1265-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 13d23d55-7076-4796-a0be-679223589e2d X-Archives-Hash: 0f420cc1bcf3bf253c555178b33cacc7 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